[Spice-devel] [PATCH spice-gtk 10/10] spice-widget: release_keys on focus out

Hans de Goede hdegoede at redhat.com
Fri Aug 12 07:50:37 PDT 2011


This fixes alt getting stuck in the guest when the user alt-tabs away from the
spice-widget (thus making it see the alt press but not the release) and then
closing it without giving it the focus back (by using the windows close button
for example).

Note that doing this on focus out (when we know we may be missing key releases
afterwards) makes a lot more sense then doing this on focus in, and with
the release_keys on focus out I don't really see a reason any more to do it
on focus in. But I'm leaving it in on focus in just in case, it certainly
cannot hurt there.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 gtk/spice-widget.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
index 7afc6eb..2015854 100644
--- a/gtk/spice-widget.c
+++ b/gtk/spice-widget.c
@@ -902,6 +902,7 @@ static gboolean focus_out_event(GtkWidget *widget, GdkEventFocus *focus G_GNUC_U
     if (d->keyboard_grab_active)
         return true;
 
+    release_keys(display);
     d->keyboard_have_focus = false;
     update_auto_usbredir(display);
     return true;
-- 
1.7.5.1



More information about the Spice-devel mailing list