GNOME Bugzilla – Bug 150897
Windows key should be able to pop up main menu
Last modified: 2020-11-07 12:35:47 UTC
The attached patch adds a gconf key /apps/metacity/general/enable_windows_keys When activated, pressing either of the Windows flag keys will tell the panel to pop up its main menu.
Created attachment 30881 [details] [review] Patch to grab the Windows flag keys and use them.
But doesn't that destroys all key combinations (and mouse modifications) for Super? It seems to me that this would be much like binding Ctrl to showing the run application dialog, thereby disabling Ctrl for everything else...
If you have a program that requires Super, you deserve to lose anyway :)
Why are we setting the keysyms of the Windows keys to SuperL/R, anyway? I've never seen a space-cadet keyboard in person, and know of no programs that require Super modifiers. Emacs doesn't count, and even it doesn't require them.
There's a large difference between /requiring/ the use of Super and being /allowed/ to use it for useful things. ;-) Metacity at one point used Super as a modifier itself. For a while, it was the default modifier for button presses (i.e. move with Super+left-click instead of Alt+left-click, resize with Super+middle-click instead of Alt+middle-click, etc.) There is still a configuration option for this (not just a gconf key). One of the nice things about super is that it provides a whole bunch of keybindings the user can bind (or the window manager, if we ever decide we want to use it?) that would be far less likely to conflict with other programs than ctrl/alt/shift ones. I even feel it is somewhat intuitive that way, think of the "Windows" key as being the one that lets me define "window manager" actions. Just my $0.02...
Maybe it is that I don't use the Alt-drag stuff to move/resize windows, but you can always use direct manipulation of graphical elements to accomplish that --- move by dragging the title bar, resize by dragging the edges, etc. The patch to use the Windows flag keys to pop up the panel menu is so that people who are used to Windows will find equivalent functionality in Gnome. [At least within Novell, people always complain when that doesn't work...] In any case, including this would not block us from later using those keys as modifiers for Metacity's purposes only. If you press and release a Windows key with no actions in the middle (e.g. click/drag), they could work like "normal" non-modifier keys; in this case they would bring up the panel menu.
Windows does it? I didn't know that. That is a good argument for this. And your ideas for being able to simultaneously use it for both purposes clears up any reservations I had. Of course, it's not my choice anyway... Havoc?
Comment on attachment 30881 [details] [review] Patch to grab the Windows flag keys and use them. Why the hardcoded keycodes? Should be able to scan for them, see the way we find Mode_switch for example. I think it's OK to assume that Super_* are the windows keys. Why do this as a special-case enable_windows_keys instead of a keybinding open_panel_menu that can be bound to the windows keys? We could hypothetically support setting any keybinding to only a modifier key, by generalizing the code in this patch, maybe...
So do we want something like boolean did_something; key_press_event (GdkEventKey *event) { if (is_modifier (event->keysym)) did_something = FALSE; ... } mouse_drag_event () { if (event->state & GDK_SOME_MODIFIER_MASK) { did_something = TRUE; move_window (); } ... } key_release_event (GdkEventKey *event) { if (is_modifier (event->keysym) && !did_something) activate_binding_for_key (event->keysym); } The idea is that you can use modifiers as bindings by themselves, or as "true" modifiers if you e.g. drag the mouse while pressing them.
Because the windows key is hardly used for shortcuts in any application (Unlike Ctrl, Alt and Shift), I really liked having it bound to window handling and workspace switching in metacity because it wouldn't clash with GIMP, Blender and other shortcut packed applications. I would really welcome if it was possible to configure the windows key NOT to open the panel menu.
Comment on attachment 30881 [details] [review] Patch to grab the Windows flag keys and use them. As per Havoc-comments.
Why make Metacity have magic special handling for the Super key? Why not just tweak the xkb settings in NLD so that the Windows keys aren't modifiers any more, so they can just be bound normally in the Shortcuts capplet? (In fact, in NLD at least, there's already an entry for "Open Panel Menu" there. Havoc's comment #8 implies that that is not part of stock metacity, in which case NLD is being extra evil by hardcoding this behavior in one place and then also providing a visible frob that looks like it ought to be able to turn it off even though it can't.) Having the Windows key irrevocably bound to anything is evil because different keyboards disagree on the layout of the modifier keys. Eg, consider switching between a Desktop PC and a ThinkPad: Desktop PC: Control Windows Alt ThinkPad: Function Control Alt (likewise for switching between a Desktop PC and a Mac, and probably with some other notebook keyboards too). I routinely end up hitting Windows when I didn't mean to, and having it pop up the panel menu every time is really annoying.
I just would like to have working the right win key as level3 chooser using xmodmap: ! keycode 116 = Super_R Multi_key keycode 116 = ISO_Level3_Shift Also if I had only one (left) win key (as I have on my notebook) I would prefer to work the win key as level3-chooser and to work as open_menu only together with shift...
*** Bug 436023 has been marked as a duplicate of this bug. ***
*** Bug 500032 has been marked as a duplicate of this bug. ***
Can somebody update the version field to "2.20.x" please?
this bug is still present in GNOME 2.22.1 please update the version field.
All that's necessary is to allow "<Super>" to be included in /apps/metacity/global_keybindings/panel_main_menu_list .
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old feature requests in Bugzilla which have not seen updates for many years. If you still use metacity and if you are still requesting this feature in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/metacity/-/issues/ Thank you for reporting this issue and we are sorry it could not be implemented.