diff mbox

[1/2] gtk: don't warp point in absolute mode

Message ID 1386637474-8165-2-git-send-email-airlied@gmail.com
State New
Headers show

Commit Message

Dave Airlie Dec. 10, 2013, 1:04 a.m. UTC
From: Dave Airlie <airlied@redhat.com>

This makes gtk act the same way as the current sdl backend, which doesn't
do the warp in this case.

If your guest GPU has hw pointer this leads you get endless loops where the
warp causes motion causes input events, causes the guest to move the cursor
causes warp.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 ui/gtk.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/ui/gtk.c b/ui/gtk.c
index 6316f5b..2abf289 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -338,6 +338,9 @@  static void gd_mouse_set(DisplayChangeListener *dcl,
     GdkDeviceManager *mgr;
     gint x_root, y_root;
 
+    if (kbd_mouse_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),