widget: fix keyboard ungrab after click

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@redhat.com>
Reported-by: Frediano Ziglio <fziglio@redhat.com>
Tested-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
This commit is contained in:
Marc-André Lureau 2016-06-20 15:18:22 +02:00
parent a3d686fb16
commit 0fafbe3d9e

View File

@ -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);
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();