]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
gtk: Don't warp absolute pointer
authorCole Robinson <crobinso@redhat.com>
Thu, 13 Mar 2014 19:30:24 +0000 (15:30 -0400)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 17 Mar 2014 13:34:28 +0000 (14:34 +0100)
This matches the behavior of SDL, and makes the mouse usable when
using -display gtk -vga qxl

https://bugzilla.redhat.com/show_bug.cgi?id=1051724
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/gtk.c

index e2394ac85972d569beabb672ee64754120906fc3..baabf865c064990cc50fca5b7397166f1970d8a7 100644 (file)
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -340,6 +340,10 @@ static void gd_mouse_set(DisplayChangeListener *dcl,
     GdkDeviceManager *mgr;
     gint x_root, y_root;
 
+    if (qemu_input_is_absolute()) {
+        return;
+    }
+
     dpy = gtk_widget_get_display(s->drawing_area);
     mgr = gdk_display_get_device_manager(dpy);
     gdk_window_get_root_coords(gtk_widget_get_window(s->drawing_area),
@@ -355,6 +359,10 @@ static void gd_mouse_set(DisplayChangeListener *dcl,
     GtkDisplayState *s = container_of(dcl, GtkDisplayState, dcl);
     gint x_root, y_root;
 
+    if (qemu_input_is_absolute()) {
+        return;
+    }
+
     gdk_window_get_root_coords(gtk_widget_get_window(s->drawing_area),
                                x, y, &x_root, &y_root);
     gdk_display_warp_pointer(gtk_widget_get_display(s->drawing_area),