From 0718f264357a13b1a55cadcb7eb6a5774b7dd7eb Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Fri, 5 May 2023 05:19:44 +0200 Subject: Fix casting issues --- src/idle-monitor.vala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/idle-monitor.vala') diff --git a/src/idle-monitor.vala b/src/idle-monitor.vala index 374e924..b8e8963 100644 --- a/src/idle-monitor.vala +++ b/src/idle-monitor.vala @@ -2,6 +2,7 @@ * * Copyright (C) 2014 Canonical Ltd * Copyright (C) 2017 Mike Gabriel + * Copyright (C) 2023 Robert Tari * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as @@ -79,7 +80,11 @@ public class IdleMonitor warning ("Only support idle monitor under X"); return; } - display = (d as Gdk.X11.Display).get_xdisplay (); + + if (d is Gdk.X11.Display) + { + display = d.get_xdisplay (); + } int sync_error_base; var res = X.Sync.QueryExtension (display, out sync_event_base, out sync_error_base); -- cgit v1.2.3