summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-08-01 12:53:21 +0200
committerraveit65 <[email protected]>2016-08-31 15:29:57 +0200
commitabdcd8d6e86dd2f573b90fd2b03fc67949546998 (patch)
tree50e78a3379940617d567c4a045a85ca3056549a8
parentb3b93d3ed0255ee38d1da2e0ea5c444f47e4d96a (diff)
downloadmate-applets-abdcd8d6e86dd2f573b90fd2b03fc67949546998.tar.bz2
mate-applets-abdcd8d6e86dd2f573b90fd2b03fc67949546998.tar.xz
GTK+-3.20 geyes: port to GtkSeat
-rw-r--r--geyes/geyes.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/geyes/geyes.c b/geyes/geyes.c
index bf4a2290..81d7b2d3 100644
--- a/geyes/geyes.c
+++ b/geyes/geyes.c
@@ -137,23 +137,37 @@ timer_cb (EyesApplet *eyes_applet)
{
#if GTK_CHECK_VERSION (3, 0, 0)
GdkDisplay *display;
+#if GTK_CHECK_VERSION (3, 20, 0)
+ GdkSeat *seat;
+#else
GdkDeviceManager *device_manager;
GdkDevice *device;
#endif
+#endif
gint x, y;
gint pupil_x, pupil_y;
gint i;
#if GTK_CHECK_VERSION (3, 0, 0)
display = gtk_widget_get_display (GTK_WIDGET (eyes_applet->applet));
+#if GTK_CHECK_VERSION (3, 20, 0)
+ seat = gdk_display_get_default_seat (display);
+#else
device_manager = gdk_display_get_device_manager (display);
device = gdk_device_manager_get_client_pointer (device_manager);
#endif
+#endif
for (i = 0; i < eyes_applet->num_eyes; i++) {
if (gtk_widget_get_realized (eyes_applet->eyes[i])) {
#if GTK_CHECK_VERSION (3, 0, 0)
+#if GTK_CHECK_VERSION (3, 20, 0)
+ gdk_window_get_device_position (gtk_widget_get_window (eyes_applet->eyes[i]),
+ gdk_seat_get_pointer (seat),
+ &x, &y, NULL);
+#else
gdk_window_get_device_position (gtk_widget_get_window (eyes_applet->eyes[i]), device, &x, &y, NULL);
+#endif
#else
gtk_widget_get_pointer (eyes_applet->eyes[i], &x, &y);
#endif