www.cendio.com

Bug 5647

Summary: keyboard grab doesn't work under Xwayland
Product: ThinLinc Reporter: Pierre Ossman <ossman@cendio.se>
Component: VNCAssignee: Pierre Ossman <ossman@cendio.se>
Status: NEW QA Contact: Bugzilla mail exporter <bugzilla-qa@cendio.se>
Severity: Normal    
Priority: P2 CC: hean01@cendio.se, samuel@cendio.se
Version: pre-1.0Keywords: upstream
Target Milestone: MediumPrio   
Hardware: PC   
OS: Unknown   
Acceptance Criteria:
Bug Depends on:    
Bug Blocks: 5646    

Description From cendio 2015-09-22 15:59:58
I tested running tlclient under Gnome and Wayland on my Fedora 22. Everything
seems to work well, except for keyboard grab. I.e. things like alt-tab do not
work properly in full screen.

This may be a general wayland problem though. See this part of the wayland
documentation:

http://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-Input

I doubt they can keep this model though as any remote access or virtualisation
product requires keyboard grab at one point or another. We'll have to keep an
eye on things and see how it develops.
------- Comment #1 From cendio 2016-07-19 09:27:43 -------
Upstream work:

https://bugzilla.redhat.com/show_bug.cgi?id=1285770
------- Comment #2 From cendio 2017-02-28 14:19:56 -------
Still a problem on Fedora 25, maybe we should try to detect and disable the
"Send system keys" option when running client on Xwayland, at least add
platform specific note.
------- Comment #3 From cendio 2017-02-28 14:43:48 -------
It's not obvious how to detect wayland as I can notice that a wayland display
socket is created even if I log in to a X11 session. However a connect to this
socket fails.

The socket is available as ${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}

Perhaps we can detect Xwayland somehow?
------- Comment #4 From cendio 2017-10-23 16:40:39 -------
Mechanisms are getting finalised. However we need to do some window manager
interaction. See this comment upstream:

https://bugzilla.gnome.org/show_bug.cgi?id=783342#c124
------- Comment #6 From cendio 2018-06-15 16:48:13 -------
This now works on Fedora Rawhide (for upstream vncviewer). Note though that the
function is disabled by default, and you have to muck around in dconf to enable
it. :/
------- Comment #7 From cendio 2019-06-18 16:23:16 -------
The setting you need to change is
"org.gnome.mutter.wayland.xwayland-allow-grabs". However upstream has now
dropped that requirement from the upcoming version:

https://gitlab.gnome.org/GNOME/mutter/merge_requests/572/diffs

So it should mean that GNOME 3.34 is easier to get working.
------- Comment #8 From cendio 2019-06-18 16:24:18 -------
The version of GNOME supporting grabs in Wayland (3.28) has now also trickled
out to distributions. Fedora has it, as does RHEL 7 and 8.
------- Comment #9 From cendio 2019-06-18 16:34:38 -------
Fixed the main part upstream, so we'll get this sorted out in the next vendor
drop:

https://github.com/TigerVNC/tigervnc/commit/da10343f32b9d3f9dcd79254627d010152ecf91e

Unfortunately I discovered that upstream had forgotten about XGrabPointer(), so
it still doesn't fully work:

https://gitlab.gnome.org/GNOME/mutter/issues/642

It gets a lot better with that first fix though.
------- Comment #10 From cendio 2019-06-25 15:30:16 -------
Also note that it is possible to get grabs working without modifying the
ThinLinc client by explicitly adding "thinlinc-client" to the dconf setting
"org.gnome.mutter.wayland.xwayland-grab-access-rules".