[Spice-devel] [PATCH spice-gtk 1/2] Do not send ungrab key sequence to the server
Hans de Goede
hdegoede at redhat.com
Fri Dec 9 08:23:31 PST 2011
Looks good, ack series.
On 12/09/2011 05:03 PM, Marc-André Lureau wrote:
> ---
> gtk/spice-widget.c | 21 ++++++++++-----------
> 1 files changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c
> index 9e45979..3c2f6c0 100644
> --- a/gtk/spice-widget.c
> +++ b/gtk/spice-widget.c
> @@ -876,6 +876,16 @@ 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)&&
> + d->mouse_mode == SPICE_MOUSE_MODE_SERVER) {
> + 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 +902,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;
> }
>
More information about the Spice-devel
mailing list