[Wayland-bugs] [Bug 780422] Focus events are not always matched

gtk+ (GNOME Bugzilla) bugzilla at gnome.org
Thu Apr 19 09:57:42 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=780422

Olivier Fourdan <ofourdan at redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ofourdan at redhat.com

--- Comment #1 from Olivier Fourdan <ofourdan at redhat.com> ---
So, I took a closer looks at this issue.

I reckon the problem comes from device_emit_grab_crossing() in
gdkdevice-wayland.c *and* the way spice-gtk uses grabs.

Basically, spice-gtk issue a grab each time the pointer enters the spice-gtk
window and release the grab when the pointer leaves the widget.

When the grab is on the keyboard (as it is here), a focus event is sent (either
focus_in of focus_out).

In gdk_wayland_device_grab(), device_emit_grab_crossing() is called only if the
current keyboard focus differs from the window on which the grab is issued.

Similarly, in gdk_wayland_device_ungrab(), device_emit_grab_crossing() is
called only if the window with a grab (if any) differs from the currently
focused window.

But entering/leaving widget does not atually change keyboard focus (it's an
emulated event), so when the user clicks on another window, a real focus_out
event is emitted.

So spice-gtk logic of issuing a _keyboard_ grab/ungrab on _pointer_ enter/leave
events defeats the logic in gdkdevice-wayland.c

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20180419/62e96809/attachment-0001.html>


More information about the wayland-bugs mailing list