[Spice-devel] [PATCH spice-gtk 10/11] Ignore the first mouse click when taking the grab

Marc-André Lureau marcandre.lureau at gmail.com
Thu Dec 8 06:12:57 PST 2011


---
 gtk/spice-widget.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 1fa54c3..08aa5a9 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -1144,12 +1144,16 @@ static gboolean button_event(GtkWidget *widget, GdkEventButton *button)
     }
 
     gtk_widget_grab_focus(widget);
-    if (d->mouse_mode == SPICE_MOUSE_MODE_SERVER)
-        try_mouse_grab(display);
-    else /* allow to drag and drop between windows/displays:
-            FIXME: should be multiple widget grab, but how?
-            or should now the position of the other widgets?..
-         */
+    if (d->mouse_mode == SPICE_MOUSE_MODE_SERVER) {
+        if (!d->mouse_grab_active) {
+            try_mouse_grab(display);
+            return true;
+        }
+    } else
+        /* allow to drag and drop between windows/displays:
+           FIXME: should be multiple widget grab, but how?
+           or should now the position of the other widgets?..
+        */
         gdk_pointer_ungrab(GDK_CURRENT_TIME);
 
     if (!d->inputs)
-- 
1.7.7.3



More information about the Spice-devel mailing list