[Xfce4-commits] [panel-plugins/xfce4-eyes-plugin] 09/16: Use gdk_window_get_device_position instead of gdk_window_get_pointer

noreply at xfce.org noreply at xfce.org
Sun Jun 5 17:47:39 CEST 2016


This is an automated email from the git hooks/post-receive script.

andre pushed a commit to branch master
in repository panel-plugins/xfce4-eyes-plugin.

commit 6ce2df8f34bce76b3634a0bebe67a88abdeb2a6c
Author: Andre Miranda <andre42m at gmail.com>
Date:   Thu May 26 00:28:55 2016 -0300

    Use gdk_window_get_device_position instead of gdk_window_get_pointer
---
 panel-plugin/eyes.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/panel-plugin/eyes.c b/panel-plugin/eyes.c
index cd1bd8b..61a64ca 100644
--- a/panel-plugin/eyes.c
+++ b/panel-plugin/eyes.c
@@ -164,12 +164,18 @@ timer_cb(EyesPlugin *eyes)
     gint x, y;
     gint pupil_x, pupil_y;
     gint i;
+    GdkWindow *window;
+    GdkDevice *mouse_device;
+
+    GdkDeviceManager *devman = gdk_display_get_device_manager (gdk_display_get_default());
+    mouse_device = gdk_device_manager_get_client_pointer (devman);
 
     for (i = 0; i < eyes->num_eyes; i++)
     {
         if (gtk_widget_get_realized (eyes->eyes[i]))
         {
-            gdk_window_get_pointer(eyes->eyes[i]->window, &x, &y, NULL);
+            window = gtk_widget_get_window (GTK_WIDGET (eyes->eyes[i]));
+            gdk_window_get_device_position (window, mouse_device, &x, &y, NULL);
 
             if ((x != eyes->pointer_last_x[i]) || (y != eyes->pointer_last_y[i]))
             {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list