[Spice-devel] [PATCH spice-gtk 1/4] Grab focus before grabing keyboard

Marc-André Lureau marcandre.lureau at gmail.com
Sun Jan 15 08:23:00 PST 2012


Make sure the display has the focus before grabing the keyboard for
the application.
---
 gtk/spice-widget.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 1dd06f1..362f313 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -483,9 +483,9 @@ static void try_keyboard_grab(SpiceDisplay *display)
         return;
 
     g_return_if_fail(gtk_widget_is_focus(widget));
-    g_return_if_fail(gtk_widget_has_focus(widget));
 
     SPICE_DEBUG("grab keyboard");
+    gtk_widget_grab_focus(widget);
 
 #ifdef WIN32
     d->keyboard_hook = SetWindowsHookEx(WH_KEYBOARD_LL, keyboard_hook_cb,
-- 
1.7.7.5



More information about the Spice-devel mailing list