diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gpm-backlight.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gpm-backlight.c b/src/gpm-backlight.c index dbb6fe8..a4629ad 100644 --- a/src/gpm-backlight.c +++ b/src/gpm-backlight.c @@ -214,6 +214,11 @@ gpm_backlight_dialog_show (GpmBacklight *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 @@ -231,11 +236,21 @@ gpm_backlight_dialog_show (GpmBacklight *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); |