[PATCH spice-gtk 3/3] spice-widget: Reconfiguring the grab is only needed on win32

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit 8a7e72e3 "widget: regrab when widget is reconfigured" adds an
ungrab + grab call to the configure event handling code. Because:
"On Windows, we need to update the cursor clip. Call ungrab&grab to update it."

But on X11 this is not needed, see man XGrabPointer, which explains that
the grab automatically adjusts to window resizing.

Not only is it not needed it is also racy, causing spiceegtk based
apps to log messages like:
(remote-viewer:9935): GSpice-WARNING **: pointer grab failed 3

This patch fixes this by disabling the ungrab + re-grab on non-win32.

Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
 gtk/spice-widget.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 82ec4ff..2dfd326 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -1668,10 +1668,12 @@ static gboolean configure_event(GtkWidget *widget, GdkEventConfigure *conf)
     d->mx = conf->x;
     d->my = conf->y;
 
+#ifdef WIN32
     if (d->mouse_grab_active) {
         try_mouse_ungrab(display);
         try_mouse_grab(display);
     }
+#endif
 
     return true;
 }
-- 
1.8.1.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]