Keys can't be grabbed under Wayland

Bug #1704870 reported by Julian Alarcon
56
This bug affects 13 people
Affects Status Importance Assigned to Milestone
remmina
New
Unknown
wayland
Confirmed
Medium
remmina (Ubuntu)
Invalid
Low
Unassigned
wayland (Fedora)
Confirmed
Undecided

Bug Description

Special keys are not working under Remmina.

Seems to be a Wayland specification and implementation of that specification.

This bug could embrace all apps that need this behavior (VirtualBox, vncviewer, etc)

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: remmina 1.1.2-4ubuntu1
ProcVersionSignature: Ubuntu 4.11.0-10.15-generic 4.11.8
Uname: Linux 4.11.0-10-generic x86_64
ApportVersion: 2.20.5-0ubuntu5
Architecture: amd64
CurrentDesktop: GNOME
Date: Mon Jul 17 15:36:36 2017
InstallationDate: Installed on 2017-07-04 (13 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170626)
SourcePackage: remmina
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
In , Pierre (pierre-redhat-bugs) wrote :

Applications such as vncviewer[1] have the option of grabbing the keyboard in order to be able to send all keyboard input to a remote system, even if the window manager would like to reserve some things for itself. This is no longer possible when these applications are running under XWayland.

I know this is currently per design in the Wayland protocol, but it is something that needs to be handled somehow.

[1] Boxes, virt-manager and such should also be affected

Revision history for this message
In , Kamil (kamil-redhat-bugs) wrote :

In virt-manager, I can't send Win key to the client, it always triggers overview mode in the host. That's probably caused by the same issue.

Revision history for this message
In , Sean (sean-redhat-bugs) wrote :

VirtualBox also suffers from this issue; it makes using my Windows 98 VM really painful.

Revision history for this message
In , Olivier (olivier-redhat-bugs) wrote :

I think this is pretty much the desired behaviour, Wayland was designed with security in mind an no Wayland client can grab the keyboard exclusively.

An X11 application running on Xwayland in Wayland is no different, it cannot "steal" keyboard events from native Wayland applications.

Revision history for this message
In , Kamil (kamil-redhat-bugs) wrote :

OK, so IIUIC, this issue should be moved to Wayland, it's not XWayland specific. Thanks for info, Olivier. Is there some solution being worked on or proposed, or is there nothing like that planned?

In my experience, not only I can't send Win key to a VM, I can't even send Alt+Tab or Win+Tab. Which makes controlling it somewhat inconvenient. I assume the same issues will be present in vncviewer and other remote desktop solutions (which might be even more inconvenient, if you're used to work remotely often or for long periods of time).

Revision history for this message
In , Rubén (rubn-redhat-bugs) wrote :

Hello.

There must be a workaround that doesnt' compromise security nor violates design requisites. I need to connect to my office computer at work from my home via a Windows 10 virtual machine with Boxes and it's really cumbersome!

Fedora 24.

Thank you!

Regards.

Revision history for this message
In , Christian (christian-redhat-bugs) wrote :

According to [1] this bug is being handled upstream at freedesktop.org by wayland devs. They are adding protocol extensions to wayland:
https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml
https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/relative-pointer/relative-pointer-unstable-v1.xml

[1] https://<email address hidden>/thread/BBPOOC4GVBJXHLKSSFLGERG6GYAU6M6U/

Revision history for this message
In , Pierre (pierre-redhat-bugs) wrote :

Those references only covers grabbing the pointer, not the keyboard.

Revision history for this message
In , Christian (christian-redhat-bugs) wrote :

(In reply to Sean Young from comment #2)
> VirtualBox also suffers from this issue; it makes using my Windows 98 VM
> really painful.

Made my day ;)

(In reply to Christian Stadelmann from comment #6)
> According to [1] this bug is being handled upstream at freedesktop.org by
> wayland devs. They are adding protocol extensions to wayland:
> https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/pointer-
> constraints/pointer-constraints-unstable-v1.xml
> https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/
> relative-pointer/relative-pointer-unstable-v1.xml
>
> [1]
> https://<email address hidden>.
> org/thread/BBPOOC4GVBJXHLKSSFLGERG6GYAU6M6U/

(In reply to Pierre Ossman from comment #7)
> Those references only covers grabbing the pointer, not the keyboard.

You are right, upstream just handles mouse, not keyboard.

Nothing relevant on https://<email address hidden>/thread/BBPOOC4GVBJXHLKSSFLGERG6GYAU6M6U/ or https://lists.freedesktop.org/mailman/listinfo/wayland-devel either.

Revision history for this message
In , IanB (ianb-redhat-bugs) wrote :

*** Bug 1353422 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Christian (christian-redhat-bugs) wrote :
Revision history for this message
In , Olivier (olivier-redhat-bugs) wrote :

(In reply to Kamil Páral from comment #4)
> OK, so IIUIC, this issue should be moved to Wayland, it's not XWayland
> specific. Thanks for info, Olivier. Is there some solution being worked on
> or proposed, or is there nothing like that planned?

See also https://lists.freedesktop.org/archives/wayland-devel/2016-August/030863.html

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora 'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 23 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Revision history for this message
In , Dimitrios (dimitrios-redhat-bugs) wrote :

Just letting you know that this is still valid bug.

I hit this bug after upgrading to Fedora 25. I logged in Wayland GNOME session (I was a user of X GNOME), and I can no longer fully control a remote desktop via VNC, using the Remmina VNC client: alt-tab, windows key etc shortcuts are all captured by the local desktop, even when I've set the remote one to full screen with full keyboard grab. This makes work very painful, so I'll have to revert back to the non-default X GNOME session.

Regarding the "security feature" argument that I've heard, I don't see it, as long as I give permission for keyboard grab by explicitly selecting it and possibly answering some dialog box. Apparently I wouldn't like random applications listening to all my keyboard events, but this is not the case here.

Revision history for this message
In , Scott (scott-redhat-bugs) wrote :

Similar experience after upgrading from 24 -> 25, the Remmina clipboard sync no longer works. I expect this has something to to with Wayland and the isolation of the windows, but have not yet looked into that.

Fedora 25
Remmina 1.2.0-rcgit-15 (1.2.0-0.23.20160914git42f5a87.fc25)

Revision history for this message
In , Lucas (lucas-redhat-bugs) wrote :

I confirm this bug using the freerdp client to connect to Windows remote desktop session. All Windows keyboard shortcuts (alt-tab, Windows-e, etc. are not sent to the remote desktop but to the local host instead.

Fedora 25
freerdp-2.0.0-12.20160909git1855e36.fc25.x86_64

In my experience, this bug effectively makes it impossible, or at least highly impractical, to use a Windows remote desktop under Wayland.

Revision history for this message
In , Kamil (kamil-redhat-bugs) wrote :

Thanks, no more confirmations are needed. We know this is simply not implemented yet. If you need this, please use the X11 session until this is fixed.

Revision history for this message
In , Pierre (pierre-redhat-bugs) wrote :

I don't think that was the right gnome bug number. :)

Revision history for this message
In , Kamil (kamil-redhat-bugs) wrote :

Ugh, thanks. Wrong tracker.

Revision history for this message
In , Andrey (andrey-redhat-bugs) wrote :

The same problem when using Remmina and VMware-view Horizon.

Revision history for this message
In , Olivier (olivier-redhat-bugs) wrote :
Revision history for this message
In , Pierre (pierre-redhat-bugs) wrote :

Nice to see this progressing. :)

Just a quick note, override redirect is the old way of fullscreen on X11 and a lot of well behaved applications ask the window manager instead. So I guess Xwayland may need support for both extensions depending on how well behaved the application is?

Revision history for this message
In , Olivier (olivier-redhat-bugs) wrote :

(In reply to Pierre Ossman from comment #21)
> Nice to see this progressing. :)
>
> Just a quick note, override redirect is the old way of fullscreen on X11 and
> a lot of well behaved applications ask the window manager instead. So I
> guess Xwayland may need support for both extensions depending on how well
> behaved the application is?

That's unrelated, this is about adding a mechanism to "emulate" grabs on Wayland, the window being O-R is just a case of where there is no workaround.

But "well behaved" X11 applications asking for fullscreen using EWMH already work fine and certainly do not need this mechanism.

Revision history for this message
In , Pierre (pierre-redhat-bugs) wrote :

It sounded like one of your (two) grab extensions was specifically for O-R windows? Fullscreen via EWMH should be able to make do using the other proposed Wayland extension.

Revision history for this message
In , Olivier (olivier-redhat-bugs) wrote :

(In reply to Pierre Ossman from comment #23)
> It sounded like one of your (two) grab extensions was specifically for O-R
> windows?

That's correct.

> Fullscreen via EWMH should be able to make do using the other
> proposed Wayland extension.

Maybe you should take this discussion on the thread upstream where this would be more appropriate than in a downstream bugzilla.

On Wayland, an X11 application running on Xwayland uses the "regular" X11 window manager which implements EWMH, it does not need any specific Wayland protocol for that, it just uses the good ol' X11 protocols.

See https://wayland.freedesktop.org/xserver.html

For example, on GNOME, mutter plays the role of Wayland compositor and X11 window manager, and mutter/gnome-shell itself relies heavily on X11/Xwayland even when running as a Wayland compositor. An X11 client wishing to map its X11 window fullscreen using EWMH does not need an O-R, it just sents the relevant WM hint on the window and the X11 window manager will map that window fullscreen if applicable.

The protocol for Xwayland I sent upstream is for O-R windows, those are not focused by X11 window managers (basically they are mostly ignored by X11 window managers, by definition, even if that's not true with compositor managers which need to draw them), so that an X11 client issuing a grab on its X11 window will never get the keyboard focus when running on Xwayland because Wayland does not have any grab mechanism to match the X11 grabbing protocol.

Revision history for this message
In , Olivier (olivier-redhat-bugs) wrote :

And to clear up any misunderstanding, there is nothing neither in the protocol nor in the sample implementation I made which is specific for O-R windows in any way, it's just that the protocols is necessary for O-R window *because* they aren't focused by X11 window managers.

Revision history for this message
In , David (david-redhat-bugs) wrote :

Adding myself to the CC list, and while here, I should add, the situation is worse still if another layer of indirection is involved. If I run virt-viewer or virt-manager as a remote X client under Xwayland, no keyboard events at all make it to the VM.

Revision history for this message
In , Attila (attila-redhat-bugs) wrote :
Revision history for this message
Julian Alarcon (julian-alarcon) wrote :
description: updated
Changed in remmina:
status: Unknown → New
Changed in wayland:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Olivier (olivier-redhat-bugs) wrote :

Fixed with native Wayland apps, x11 fix pending review/merge.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in remmina (Ubuntu):
status: New → Confirmed
Changed in wayland (Fedora):
importance: Unknown → Undecided
status: Unknown → Confirmed
Revision history for this message
In , Matěj (matj-redhat-bugs) wrote :

I wonder whether it is the same bug, but I don’t have ANY keys inside of the VM machine when virt-manager runs under Xsession. Is it?

Revision history for this message
In , Christophe (christophe-redhat-bugs) wrote :

(In reply to Matěj Cepl from comment #29)
> I wonder whether it is the same bug, but I don’t have ANY keys inside of the
> VM machine when virt-manager runs under Xsession. Is it?

Could it be https://bugzilla.redhat.com/show_bug.cgi?id=1479682 ?

Revision history for this message
In , Olivier (olivier-redhat-bugs) wrote :

(In reply to Christophe Fergeau from comment #30)
> (In reply to Matěj Cepl from comment #29)
> > I wonder whether it is the same bug, but I don’t have ANY keys inside of the
> > VM machine when virt-manager runs under Xsession. Is it?
>
> Could it be https://bugzilla.redhat.com/show_bug.cgi?id=1479682 ?

If this affects virt-manager under a plain X session (as comment 30 states), then it's completely unrelated to either bugs (i.e. neither Wayland nor Xwayland).

Revision history for this message
In , Rubén (rubn-redhat-bugs) wrote :

It works for me after upgrading to Fedora 27 (gnome-boxes)

Thanks very much.

Revision history for this message
opensas (opensas) wrote :

I can confirm that this bug is still present using gnome with ubuntu 18.04.lts

I'll give it a try in another pc with ubuntu 20.04 beta and tell you about it

Changed in remmina (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Low
Revision history for this message
Thomas Quaglio (mjdon) wrote :

It still happens with remmina on Ubuntu 20.04.
Is it low importance for Ubuntu because we can go back to XOrg? It also means it is a blocker for wayland.

Revision history for this message
Sebastien Bacher (seb128) wrote :

> Is it low importance for Ubuntu because we can go back to XOrg?

it's low importance because wayland isn't the default, it's not recommended and used by less than 1% of our userbase according to our metrics

Revision history for this message
Esokrates (esokrarkose) wrote :

No longer a problem in Ubuntu 21.04. In gnome settings go to "Applications", select Remmina and toggle "Inhibit system keyboard shortcuts". That gives the application permission to grab the keyboard.

Changed in remmina (Ubuntu):
status: Triaged → Invalid
Revision history for this message
Lyndon Lapierre (ljlapierre) wrote :

I'm still seeing the issue in Ubuntu 21.04, not with Remmina but with 2 other keyboard-capturing applications (Citrix Workspace App, Parsec). I tried the fix from Esokrates under Applicaitons but I don't see any such options for the two apps in question. Is it a limitation when they're using XWayland?

Revision history for this message
daniel venema (d-venema) wrote (last edit ):

Issue is still present in 21.10 Wayland in combination with Citrix Workspace App.
No options / toggle for Citrix in Gnome settings.

update 2022-06-20: solution for Citrix found with the help of https://wiki.archlinux.org/title/citrix#Troubleshooting.
Although no settings present in the Application Settings menu in Ubuntu, they are configurable through gsettings or dconf-editor.
For reference I would like to link to AskUbuntu where someone was also specifically asking for a solution for Citrix:
https://askubuntu.com/questions/1385296/ubuntu-21-10-gnome-40-citrix-keyboard-combinations

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.