diff options
author | raveit65 <[email protected]> | 2016-06-03 20:12:53 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-06-07 11:01:56 +0200 |
commit | 0d633f368b7ddc943ed51ac93d1a389f41a57906 (patch) | |
tree | a1d5153ccf393f300271d552ddf55599fa66477d /src/gpm-kbd-backlight.c | |
parent | f05a301299065fd6794ad09361e31375c790fd5d (diff) | |
download | mate-power-manager-0d633f368b7ddc943ed51ac93d1a389f41a57906.tar.bz2 mate-power-manager-0d633f368b7ddc943ed51ac93d1a389f41a57906.tar.xz |
GTK+-3 gpm-kbd-backlight: replace deprecated gdk_display_get_pointer
gdk_display_get_pointer --> gdk_device_get_position
Diffstat (limited to 'src/gpm-kbd-backlight.c')
-rw-r--r-- | src/gpm-kbd-backlight.c | 15 |
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); |