Bug 213046 - graphical console should allow vt switching
Summary: graphical console should allow vt switching
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: virt-manager
Version: 5.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Daniel Berrangé
QA Contact:
URL:
Whiteboard:
Depends On: 429052
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-10-30 17:46 UTC by Matthias Clasen
Modified: 2008-06-23 19:25 UTC (History)
2 users (show)

Fixed In Version: 5.2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-06-23 19:25:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
demo (5.00 KB, text/plain)
2006-11-01 15:16 UTC, Matthias Clasen
no flags Details

Description Matthias Clasen 2006-10-30 17:46:48 UTC
It would be nice if there was a gui way to switch vt's, otherwise you always
have to log in to do a chvt, and if you end up on a vt where you cannot log in,
you are stuck...

Comment 1 Daniel Berrangé 2006-10-30 17:56:36 UTC
We already do a full keyboard grab when the mouse enters the window. This
doesn't stop X processing the  VT switch bindings. So even with the keygrab,
Ctrl+Alt+F* still switches the local VT, not the remote one. Any ideas for how
to stop X processing the Ctrl+Alt+F* sequences when keyboard grab is active are
welcome, but we can't find any thus far....

Thus to get around this we implemented 'sticky' modifier keys. eg, if you tap a
modifier key  3-times in a row, it sticks on until the next non-modifier key is
released. So you can do   'Ctrl    Ctrl   Ctrl    Alt+F1'  to simulate Ctrl+Alt+F1


Comment 2 RHEL Program Management 2006-10-30 18:00:50 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 Matthias Clasen 2006-10-31 13:41:55 UTC
Have you investigated how vmware captures the Ctrl-Alt-Fn events ?
I think Ctrl Ctrl Ctrl is a bit too undiscoverable to be of much use.
I would expect to simply add a  "Switch VT" menuitem, which could then
ask for the number of the vt to switch to.

Comment 4 Daniel Berrangé 2006-10-31 13:59:11 UTC
A 'Switch VT' menu item is rather Linux specific. We need to find a more general
solution to the problem, since other OS will have different actions which can be
affected. Probably need to have some tool-bar buttons to let you graphically
press 'Ctrl' or 'Alt' or a number of other special modifier keys.  

I've been unable to figure out how VMWare manages it since they're obviously
closed source. I was hoping the XKeyboardGrab would do the trick. The only way
to block it found thus far is to use xmodmap to explicitly unmap all the
VT_Switch keyboard symbol, but this is a rather permanent & global change - we
only want to block them when we have keyboard focus.


Comment 5 Matthias Clasen 2006-10-31 16:18:05 UTC
> A 'Switch VT' menu item is rather Linux specific. We need to find a more general
> solution to the problem, since other OS will have different actions which can be
> affected. Probably need to have some tool-bar buttons to let you graphically
> press 'Ctrl' or 'Alt' or a number of other special modifier keys.  

I strongly disagree. Having "Ctrl" and "Alt" buttons in the toolbar is
ridiculous from a ui perspective. If you want a good interface, it will have to
be specific to the capabilities of the underlying system. If this is
linux-specific, fine. Just provide a configure switch to not build it on systems
where it does not make sense.

Comment 6 Matthias Clasen 2006-10-31 16:25:22 UTC
Actually, Ray just reminds me that XKB has means to reconfigure the action bound
to the Switch_VT keysym. Thats probably the best route to explore. 

Also, Ray explained to me why a "Switch VT" button does not make much sense in
general, because it depends on the gues OS that is running inside whether it makes
sense or not. Ray proposed to have a "Grab Keyboard" menuitem instead. The way
it would work is that if "grab keyboard" is turned on, the console window would
on focus-in reconfigure xkb to not do the Switch_VT action, and grab those keys
itself, and undo the xkb reconfiguration on focus-out.

Comment 7 Daniel Berrangé 2006-10-31 16:27:12 UTC
The trouble is that this isn't dependant on the capabilities of the host system
being used, so a compile/configure switch is useless. The set of key shortcuts
we need to pass to a guest is the dependant on what guest operating system we
are running in the console - which we have no way to find out.

Comment 8 Daniel Berrangé 2006-10-31 16:27:59 UTC
Ahh, thanks for the XKB info - I'll investigate this approach...

Comment 9 Matthias Clasen 2006-10-31 16:28:49 UTC
Actually, Ray just reminds me that XKB has means to reconfigure the action bound
to the Switch_VT keysym. Thats probably the best route to explore. 

Also, Ray explained to me why a "Switch VT" button does not make much sense in
general, because it depends on the gues OS that is running inside whether it makes
sense or not. Ray proposed to have a "Grab Keyboard" menuitem instead. The way
it would work is that if "grab keyboard" is turned on, the console window would
on focus-in reconfigure xkb to not do the Switch_VT action, and grab those keys
itself, and undo the xkb reconfiguration on focus-out.

Comment 10 Matthias Clasen 2006-11-01 15:15:47 UTC
I had some fun last night trying to figure out how to use XKB to unbind the
switch vt action. I'll attach a little test program that shows how it can be done.

If you run it, it will prevent Ctrl-Alt-Fn to switch vts whenever it has focus.
It also tries to do the same thing for TerminateServer (Ctrl-Alt-Backspace), but
that does not work due to X server bugs.

Comment 11 Matthias Clasen 2006-11-01 15:16:54 UTC
Created attachment 139992 [details]
demo

Of course, the demo is in C and using XKB api, so it may not be trivial to
translate that into python code...

Comment 13 RHEL Program Management 2007-09-07 20:02:36 UTC
This request was previously evaluated by Red Hat Product Management
for inclusion in the current Red Hat Enterprise Linux release, but
Red Hat was unable to resolve it in time.  This request will be
reviewed for a future Red Hat Enterprise Linux release.

Comment 14 Daniel Berrangé 2008-01-23 03:43:14 UTC
In RHEL-5.2, virt-manager-0.5.3 has a menu which allows sending of the
Ctrl+Alt+Fn, and Ctrl+Aalt+Backspace, Delete sequences.

Comment 15 Cole Robinson 2008-06-23 19:25:18 UTC
As mentioned in previous comment, this functionality is available in 5.2.
Closing as CURRENTRELEASE.


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