Comment 3 for bug 1726910

Revision history for this message
Peter Wu (lekensteyn) wrote :

Current QEMU code (at least, v2.12.0-329-ge5cd695266) does not grab the F10 key ("menubar activate"), accelerators (Ctrl-Alt-1) or menu bar "mnemonic"s (such as Alt-V for _V_iew).

This comment nicely summarizes what kind of grabs is needed:
https://bugzilla.redhat.com/show_bug.cgi?id=499362#c1
This is the corresponding implementation:
https://github.com/SPICE/virt-viewer/blob/4048d28de853854a57835e91fb8758e78bc9ecd5/src/virt-viewer-window.c#L696

Changing the "gtk-enable-accels" setting on the window should still work in order to disable accelerators such as Ctrl-Alt-G and Ctrl-Alt-1. Being able to switch to the monitor (e.g. to issue "sendkey ..." is important, so something else should probably catch this. Or else just accept that the grab key has to be pressed first.

Alt-M (Menu) and Alt-V (View) are not that commonly used shortcuts, these could be removed/disabled with a grab if desired, but otherwise I am not annoyed by it.

The F10 key however is used for various purposes in applications and must be passed to the guest.
Unfortunately, Timm Bäder removed the "gtk-menu-bar-accel" property in GTK+ 3.22.1-295-gb082fb598d (Oct 2016) which means that the F10 shortcut can no longer be disabled using said property. So now another hack is needed to prevent "gtk_window_activate_key" (gtk/gtkwindow.c) from triggering this menu bar.