[Spice-devel] [PATCH spice-gtk] widget: fix keyboard ungrab after click

Fabiano Fidêncio fabiano at fidencio.org
Mon Jun 20 15:28:12 UTC 2016


On Mon, Jun 20, 2016 at 3:22 PM,  <marcandre.lureau at redhat.com> wrote:
> From: Marc-André Lureau <marcandre.lureau at redhat.com>
>
> Since the switch to a container widget (gtkstack then gtkeventbox), the
> grab may be lost when clicking on the display. Since events are treated
> at the top level container, set widget "above-child" to trap all of them
> to solve this.
>
> Fixes:
> https://bugs.freedesktop.org/show_bug.cgi?id=96595
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
> Reported-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  src/spice-widget.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/spice-widget.c b/src/spice-widget.c
> index 4ca74bf..4cfbcfa 100644
> --- a/src/spice-widget.c
> +++ b/src/spice-widget.c
> @@ -632,6 +632,8 @@ static void spice_display_init(SpiceDisplay *display)
>                            GDK_KEY_PRESS_MASK |
>                            GDK_SCROLL_MASK);
>      gtk_widget_set_can_focus(widget, true);
> +    gtk_event_box_set_above_child(GTK_EVENT_BOX(widget), true);

I'd just do: s/true/TRUE before pushing, but no need to resend the
patch because of this is just my preference :-)

> +
>      d->grabseq = spice_grab_sequence_new_from_string("Control_L+Alt_L");
>      d->activeseq = g_new0(gboolean, d->grabseq->nkeysyms);
>      d->mouse_cursor = get_blank_cursor();
> --
> 2.7.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel


Acked-by: Fabiano Fidêncio <fidencio at redhat.com>
-- 
Fabiano Fidêncio


More information about the Spice-devel mailing list