[Spice-devel] [PATCH spice-gtk] spice-widget: fixing issue with keyboard already grabbed
Julio Faracco
jcfaracco at gmail.com
Mon May 21 03:50:38 UTC 2018
For some reason, after unlocking a locked screen, spice receives an
enter event before focus-in event (this possible a Gtk issue). This
wrong sequence of events is causing a wrong mouse focus. This operation
gives to enter event the ability to grab keyboard and when focus-in
event is raised, keyboard is already grabbed by enter event.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1485968
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1571422
Signed-off-by: Julio Faracco <jcfaracco at gmail.com>
---
src/spice-widget.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/spice-widget.c b/src/spice-widget.c
index 767550b..650c314 100644
--- a/src/spice-widget.c
+++ b/src/spice-widget.c
@@ -1805,8 +1805,12 @@ static gboolean enter_event(GtkWidget *widget, GdkEventCrossing *crossing G_GNUC
DISPLAY_DEBUG(display, "%s", __FUNCTION__);
- d->mouse_have_pointer = true;
- spice_gtk_session_set_mouse_has_pointer(d->gtk_session, true);
+ if (spice_gtk_session_get_keyboard_has_focus(d->gtk_session) &&
+ spice_gtk_session_get_mouse_has_pointer(d->gtk_session)) {
+ d->mouse_have_pointer = true;
+ spice_gtk_session_set_mouse_has_pointer(d->gtk_session, true);
+ }
+
try_keyboard_grab(display);
update_display(display);
--
2.17.0
More information about the Spice-devel
mailing list