[Spice-devel] [PATCH spice-gtk] RFC: win32: do not handle win keys when the keyboard is not grabbed

Hans de Goede hdegoede at redhat.com
Tue Apr 2 10:12:44 PDT 2013


ACK.

On 04/02/2013 06:15 PM, Marc-André Lureau wrote:
> Special-case on win32, filter out the win keys when not having the
> keyboard grab. This is to avoid the win keys to be received both by
> the guest and the client, which can be undesirable in general.
>
> https://bugzilla.redhat.com/show_bug.cgi?id=873341
> ---
>   gtk/spice-widget.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
> index 324f5ee..233b49f 100644
> --- a/gtk/spice-widget.c
> +++ b/gtk/spice-widget.c
> @@ -1278,6 +1278,14 @@ static gboolean key_event(GtkWidget *widget, GdkEventKey *key)
>       /* on windows, we ought to ignore the reserved key event? */
>       if (key->hardware_keycode == 0xff)
>           return false;
> +
> +    if (!d->keyboard_grab_active) {
> +        if (key->hardware_keycode == VK_LWIN ||
> +            key->hardware_keycode == VK_RWIN ||
> +            key->hardware_keycode == VK_APPS)
> +            return false;
> +    }
> +
>   #endif
>       SPICE_DEBUG("%s %s: keycode: %d  state: %d  group %d modifier %d",
>               __FUNCTION__, key->type == GDK_KEY_PRESS ? "press" : "release",
>


More information about the Spice-devel mailing list