[Spice-devel] [PATCH spice-gtk 10/10] spice-widget: release_keys on focus out
Christophe Fergeau
cfergeau at redhat.com
Wed Aug 17 08:43:01 PDT 2011
Looks good, ack from me
Christophe
On Fri, Aug 12, 2011 at 04:50:37PM +0200, Hans de Goede wrote:
> 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
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110817/26cc5a72/attachment.pgp>
More information about the Spice-devel
mailing list