summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-26 17:49:16 +0100
committerinfirit <[email protected]>2014-11-26 18:13:43 +0100
commite74900ace7f20ad3cf3317a40b5026ce69112d2e (patch)
tree4b00434a8e980d6714cc4789344b86ada467ae61
parent507a1a6f6363a542ccf5aa3b5e6fa607deed591d (diff)
downloadmate-applets-e74900ace7f20ad3cf3317a40b5026ce69112d2e.tar.bz2
mate-applets-e74900ace7f20ad3cf3317a40b5026ce69112d2e.tar.xz
Gtk3: geyes: don't use deprecated gtk_widget_get_pointer
Based on gnome-applets commit: d3a667ae31a08dfc2cbc40bfc64e378474117358 From: Alberts Muktupāvels <[email protected]>
-rw-r--r--geyes/geyes.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/geyes/geyes.c b/geyes/geyes.c
index a2becb72..262f63db 100644
--- a/geyes/geyes.c
+++ b/geyes/geyes.c
@@ -160,14 +160,28 @@ draw_eye (EyesApplet *eyes_applet,
static gint
timer_cb (EyesApplet *eyes_applet)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkDisplay *display;
+ GdkDeviceManager *device_manager;
+ GdkDevice *device;
+#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));
+ device_manager = gdk_display_get_device_manager (display);
+ device = gdk_device_manager_get_client_pointer (device_manager);
+#endif
+
for (i = 0; i < eyes_applet->num_eyes; i++) {
if (gtk_widget_get_realized (eyes_applet->eyes[i])) {
- gtk_widget_get_pointer (eyes_applet->eyes[i],
- &x, &y);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_window_get_device_position (gtk_widget_get_window (eyes_applet->eyes[i]), device, &x, &y, NULL);
+#else
+ gtk_widget_get_pointer (eyes_applet->eyes[i], &x, &y);
+#endif
if ((x != eyes_applet->pointer_last_x[i]) || (y != eyes_applet->pointer_last_y[i])) {
calculate_pupil_xy (eyes_applet, x, y, &pupil_x, &pupil_y, eyes_applet->eyes[i]);