Bug 1396643 - virt-viewer-1.4.0 steals Alt key from key combinations: Ctrl-Alt-Delete, Alt-Shift
Summary: virt-viewer-1.4.0 steals Alt key from key combinations: Ctrl-Alt-Delete, Alt-...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: virt-viewer
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Daniel Berrangé
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-18 19:33 UTC by anton.gubarkov@gmail.com
Modified: 2020-09-11 08:14 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-11 08:14:45 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Gentoo 599728 0 None None None 2016-11-18 19:33:38 UTC

Description anton.gubarkov@gmail.com 2016-11-18 19:33:39 UTC
Description of problem:
When virt-viewer is run from Gnome session on wayland, the key combinations Ctrl+Alt+Del and Alt-Shift are not sent to VM, but are interpreted by Gnome instead.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.Login to Gnome wayland session
2.Start the VM and connect to it.
3.Press Ctrl+Alt+Del

Actual results:
Gnome tries to restart  the host machine

Expected results:
Ctrl+Alt+Del is sent to VM and processed there

Additional info:

Comment 1 Steven Sheehy 2017-02-17 16:15:38 UTC
This sounds like the same issue I'm experiencing on Fedora 25 with Wayland. Except that mine is for Alt+Tab combinations being sent to the host machine (haven't tried the other key combinations). Makes it very frustrating to navigate windows when within the VM. Any hints where I can look in the code to fix this?

Comment 2 Daniel Berrangé 2017-02-17 16:35:08 UTC
The design of wayland intentionally prevents applications from doing full keyboard grabbing as they would under X11, in order to provide a more secure architecture.

Clearly this is bad for the apps like virt-viewer/vncviewer/etc which genuinely need this feature and aren't trying to exploit the desktop but there's no obvious short term fix that can be done here

https://bugs.freedesktop.org/show_bug.cgi?id=97333
https://bugzilla.redhat.com/show_bug.cgi?id=1285770
https://lists.fedoraproject.org/archives/list/desktop@lists.fedoraproject.org/thread/BBPOOC4GVBJXHLKSSFLGERG6GYAU6M6U/

IOW, there's little choice but to revert to X11 for the forseeable future if this is important :-(

Comment 3 Steven Sheehy 2017-02-17 17:43:08 UTC
Thanks for the response. That makes sense, I figured it was something to do with wayland compatability.

I have an idea for a workaround which I'm sure you'll probably tell me isn't feasible. What if we use USB redirection for the keyboard but provide some way to un-redirect with some key combination? I accidentally redirected my keyboard/mouse to workaround another mouse issue and was unable to escape out of the VM after that and had to restart. So while my input was trapped in the VM Alt+Tab actually worked. The downside is currently there is no ungrab VM option, which should probably be addressed anyway (I can open a separate issue).

Comment 4 Daniel Berrangé 2017-02-17 18:01:55 UTC
I don't really want to mess around with redirecting host input devices in that way - as you found out, once you do that there's no possible key sequence to escape as its completely invisible to the host. We need to wait for development of APIs to let us do proper grabbing & shortcut intercept under wayland/gnome.

Comment 5 John Bester 2018-12-10 16:31:50 UTC
While I do understand that users should be able to expect the same behaviour in X11 and Wayland, I would like to make a feature suggestion. If work on this needs to be done, how difficult would it be to allow users to define keys they want to be interpreted by the host in stead of the guest. For example, I use Ctrl+Alt+Up and Ctrl+Alt+Down to switch between workspaces in Gnome. It would be great if you could configure keystrokes like this to not be passed to the guest. Keys defined (either per vm or for all vms) should then be automatically added to the "Send key combination" menu.

Comment 6 Daniel Berrangé 2020-09-11 08:14:45 UTC
Closing since we now have improved keyboard grab facility under wayland


Note You need to log in before you can comment on or make changes to this bug.