Bug 478418 - virt-manager prevents key combinations like alt-f from being sent to the guest
Summary: virt-manager prevents key combinations like alt-f from being sent to the guest
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: virt-manager
Version: 12
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Daniel Berrangé
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 529082 (view as bug list)
Depends On:
Blocks: F11VirtTarget
TreeView+ depends on / blocked
 
Reported: 2008-12-29 20:07 UTC by Zing
Modified: 2010-01-04 20:03 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 499362 (view as bug list)
Environment:
Last Closed: 2010-01-04 20:03:57 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Zing 2008-12-29 20:07:46 UTC
Description of problem:
I'm trying to send, for example, alt-f to the guest, but this always opens the top file menu of virt-manager/virt-viewer, regardless of whether the pointer is grabbed or not.

I can clearly see on the frame window: "Press Ctrl+Alt to release pointer.  XXXXX Virtual Machine", but alt-f immediately opens the file menu. This is true of any of the top menu bar accelerators like alt-m/alt-v/alt-h.  The alt-keys should be passed to the guest in this situation, right?

Version-Release number of selected component (if applicable):
vnc-libs-4.1.2-35.fc10.x86_64              
vnc-4.1.2-35.fc10.x86_64             
gtk-vnc-python-0.3.8-1.fc10.x86_64     
gtk-vnc-0.3.8-1.fc10.x86_64                
libvirt-python-0.5.1-2.fc10.x86_64          
libvirt-0.5.1-2.fc10.x86_64              
virt-viewer-0.0.3-3.fc10.x86_64          
virt-manager-0.6.0-5.fc10.x86_64       
python-virtinst-0.400.0-5.fc10.noarch    
kernel-2.6.27.9-159.fc10.x86_64

How reproducible:
always

Steps to Reproduce:
1. install a guest (i'm using f10 guest in kvm on an intel x86_64 cpu)
2. start/open the guest
3. click the view of the guest to focus it
4. press alt-f
  
Actual results:
5. the file menu opens

Expected results:
5. alt-f sent to guest

Additional Info:
In web searches I saw some posts on trying something like "alt alt alt" then "f" to send the combo onward, but this didn't seem to do anything in my testing.  I just got the letter "f" on my command line in the guest.

Comment 1 Zing 2008-12-29 21:10:21 UTC
Additional Note:

I just noticed the guest actually sees the alt keypress, but it gets "stuck".  So if I press alt-f then press esc to make the file menu go away and then go back to the guest, all the following keypresses are as if the alt key is also pressed down.  Very confusing.  Pressing alt again "releases" the "stuck" alt key.

I also checked my preferences for "Grab keyboard output" which is set to "On mouse over", but it doesn't matter what I set it to, I still see the same symptoms.

Comment 2 Cole Robinson 2009-01-24 19:28:18 UTC
I can reproduce, reassigning to gtk-vnc.

Comment 3 Daniel Berrangé 2009-05-06 11:17:45 UTC
This isn't something that can be solved at the GTK-VNC level.

While GTK-VNC will grab the keyboard, this merely ensures keyboard input always gets directed to the app using GTK-VNC. We can't stop other widgets in the app seeing some key sequences, because these magic sequences are handled by GTK before the key event even gets given to GTK-VNC widget.

There are 3 types of key sequence an application needs to block:


 - The GTK menu bar accelerator key (ie F10 which activates menu bar)
 - Accelerators for the application window (eg, Ctrl+Q -> Quit menu option)
 - Menu bar shortcuts  (eg,  Alt-F activates file menu)


virt-manager currently only blocks the first two. It needs to also block the last.

It can do this by connecting a callback to the 'mnemonic-activate' signal on each top level menu. The callback should simply ignore the signal, thus blocking normal GTK processing.  virt-manager should add this callback when seeing the 'vnc-keyboard-grab' signal from GTK-VNC, and remove this callback when seeing 'vnc-keyboard-ungrab'.

Comment 4 Jens Petersen 2009-05-21 23:14:41 UTC
Well then better just to drop all the menu accelerators IMHO for now- this is extremely annoying!

Eg in anaconda installs (where I usually hit this) I additionally need to press Alt-Tab after bringing input back to the guest in order to get wm focus back to anaconda.

Comment 5 Jens Petersen 2009-05-21 23:17:25 UTC
Also happens in rawhide (f11).

Comment 6 Bug Zapper 2009-06-09 10:32:29 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Jens Petersen 2009-09-18 06:37:48 UTC
still happens for f12 rawhide

Comment 8 Justin M. Forbes 2009-10-14 21:30:58 UTC
*** Bug 529082 has been marked as a duplicate of this bug. ***

Comment 9 Cole Robinson 2009-11-02 00:16:01 UTC
This is now upstream. Turned out to be pretty easy using gtk.Settings "gtk-enable-mnemonics" available since gtk 2.12:

http://hg.fedorahosted.org/hg/virt-manager/rev/43585a028ab7

Comment 10 Bug Zapper 2009-11-16 09:44:56 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 11 Fedora Update System 2009-12-03 23:47:28 UTC
virt-manager-0.8.1-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/virt-manager-0.8.1-1.fc12

Comment 12 Fedora Update System 2009-12-04 23:34:36 UTC
virt-manager-0.8.1-1.fc12 has been pushed to the Fedora 12 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update virt-manager'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F12/FEDORA-2009-12603

Comment 13 Cole Robinson 2010-01-04 20:03:57 UTC
Fixed in virt-manager-0.8.2-1.fc12, now in stable.


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