summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-06-03 20:09:18 +0200
committerraveit65 <[email protected]>2016-06-07 11:01:56 +0200
commit5a4be0f9d28a3dfd4f0e50b97b22ac1dd493311b (patch)
tree04c81b1852f0a44be7786067e07ecc7c82021ddf
parent61e3e2b7a6942c3283500728af2a956d2a1b9b1f (diff)
downloadmate-power-manager-5a4be0f9d28a3dfd4f0e50b97b22ac1dd493311b.tar.bz2
mate-power-manager-5a4be0f9d28a3dfd4f0e50b97b22ac1dd493311b.tar.xz
GTK+-3 gpm-backlight: replace deprecated gdk_display_get_pointer
gdk_display_get_pointer --> gdk_device_get_position
-rw-r--r--src/gpm-backlight.c15
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);