gtk: Fix mouse warping with gtk3
authorCole Robinson <crobinso@redhat.com>
Thu, 13 Mar 2014 19:30:23 +0000 (15:30 -0400)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 17 Mar 2014 13:34:28 +0000 (14:34 +0100)
We were using the wrong coordinates, this fixes things to match the
original gtk2 implementation.

You can see this error in action by using -vga qxl, however even after this
patch the mouse warps in small increments up and to the left, -7x and -3y
pixels at a time, until the pointer is warped off the widget. I think it's
a qxl bug, but the next patch covers it up.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/gtk.c

index 016804d3c26238a39e96779c83367df7cb065089..e2394ac85972d569beabb672ee64754120906fc3 100644 (file)
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -346,7 +346,7 @@ static void gd_mouse_set(DisplayChangeListener *dcl,
                                x, y, &x_root, &y_root);
     gdk_device_warp(gdk_device_manager_get_client_pointer(mgr),
                     gtk_widget_get_screen(s->drawing_area),
-                    x, y);
+                    x_root, y_root);
 }
 #else
 static void gd_mouse_set(DisplayChangeListener *dcl,