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

marcandre.lureau at redhat.com marcandre.lureau at redhat.com
Mon Jun 20 13:22:37 UTC 2016


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);
+
     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



More information about the Spice-devel mailing list