summaryrefslogtreecommitdiff
path: root/geyes/geyes.c
diff options
context:
space:
mode:
Diffstat (limited to 'geyes/geyes.c')
-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