[Spice-devel] [PATCH spice-gtk] Do not send ungrab key sequence

Marc-André Lureau marcandre.lureau at gmail.com
Fri Dec 9 07:31:58 PST 2011


---
 gtk/spice-widget.c |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 9e45979..d3647a4 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -876,6 +876,15 @@ static gboolean key_event(GtkWidget *widget, GdkEventKey *key)
             __FUNCTION__, key->type == GDK_KEY_PRESS ? "press" : "release",
             key->hardware_keycode, key->state, key->group);
 
+    if (check_for_grab_key(display, key->type, key->keyval)) {
+        g_signal_emit(widget, signals[SPICE_DISPLAY_GRAB_KEY_PRESSED], 0);
+        if (d->mouse_grab_active)
+            try_mouse_ungrab(display);
+        else
+            try_mouse_grab(display);
+        return true;
+    }
+
     if (!d->inputs)
         return true;
 
@@ -892,17 +901,6 @@ static gboolean key_event(GtkWidget *widget, GdkEventKey *key)
         break;
     }
 
-    if (check_for_grab_key(display, key->type, key->keyval)) {
-        g_signal_emit(widget, signals[SPICE_DISPLAY_GRAB_KEY_PRESSED], 0);
-        if (d->mouse_grab_active)
-            try_mouse_ungrab(display);
-        else
-            /* TODO: gtk-vnc has a weird condition here
-               if (!d->grab_keyboard || !d->absolute) */
-            try_mouse_grab(display);
-    }
-
-
     return true;
 }
 
-- 
1.7.7.3



More information about the Spice-devel mailing list