summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gpm-kbd-backlight.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gpm-kbd-backlight.c b/src/gpm-kbd-backlight.c
index 0c3eb50..cdfadbc 100644
--- a/src/gpm-kbd-backlight.c
+++ b/src/gpm-kbd-backlight.c
@@ -190,6 +190,11 @@ gpm_kbd_backlight_dialog_show (GpmKbdBacklight *backlight)
GdkScreen *pointer_screen;
GdkRectangle geometry;
int monitor;
+#if GTK_CHECK_VERSION(3,0,0)
+ GdkDisplay *display;
+ GdkDeviceManager *device_manager;
+ GdkDevice *device;
+#endif
/*
* get the window size
@@ -207,11 +212,21 @@ gpm_kbd_backlight_dialog_show (GpmKbdBacklight *backlight)
}
pointer_screen = NULL;
+#if GTK_CHECK_VERSION(3,0,0)
+ display = gtk_widget_get_display (backlight->priv->popup);
+ device_manager = gdk_display_get_device_manager (display);
+ device = gdk_device_manager_get_client_pointer (device_manager);
+ gdk_device_get_position (device,
+ &pointer_screen,
+ &pointer_x,
+ &pointer_y);
+#else
gdk_display_get_pointer (gtk_widget_get_display (backlight->priv->popup),
&pointer_screen,
&pointer_x,
&pointer_y,
NULL);
+#endif
monitor = gdk_screen_get_monitor_at_point (pointer_screen,
pointer_x,
pointer_y);