GNOME Bugzilla – Bug 552318
menubar mnemonics consumed even when gtk-enable-mnemonics=false
Last modified: 2008-10-20 14:04:33 UTC
Please describe the problem: I went to Edit->Keyboard Shortcuts in gnome-terminal to configure alternate keyboard shortcuts using Alt instead of Ctrl, but not all shortcuts work. The shortcut editor allows me to configure the shortcut and the new shortcut appears in the menus, but shortcuts for alt+t (new tab) and alt+v (paste), do not work. The other custom-configured shortcuts do work - alt+n (new window), alt+w (close tab), alt+c (copy), and alt+q (close window) do work as expected. I had to disable the alt-key menu-access option to allow me to create the shortcuts in the first place. After they were created, I left alt-key menu-access unchecked, and it still didn't work. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information: This was reported on Launchpad: https://bugs.launchpad.net/bugs/268012
I can verify this and it is causing me great pain. The fact that some short cuts work, and others do not is absurd. I can't find any reason why alt-v would stop working, and can confirm it has worked for at least since at least 2002 or so - now it's regressed.
This appears to be either a gtk+ bug, or by design. Moving to gtk+ for consideration. What happens is that even if the gtk-enable-mnemonics setting is FALSE, the mnemonics of menubar items are catched (they don't activate the menu, but they're consumed). Attached testcase reproduces the behaviour. Steps: 0) Compile & run testcase 1) Press Alt-E 2) Press Alt-F 3) Dismiss menu and toggle the "Show mnemonics" checkbutton off 4) Press Alt-F Results: In step 1, the console prints "Action Item2 activated" showing that the mnemonic Alt-E works. In step 4, nothing is printed, showing that the Alt-F mnemonic is still consumed by the menu even though the mnemonics are not shown.
Created attachment 120507 [details] testcase.c
Created attachment 120526 [details] [review] a patch Here is a patch that might do the right thing.
Yes, that looks right. It fixes the testcase as well as the original problem in gnome-terminal in my testing.
2008-10-13 Matthias Clasen <mclasen@redhat.com> Bug 552318 – menubar mnemonics consumed even when gtk-enable-mnemonics=false * gtk/gtkwindow.c (gtk_window_activate_key): Don't let mnemonic entries block accelerator activation when gtk-enable-mnemonics is FALSE. Problem reported by Andreas Moog.
*** Bug 557084 has been marked as a duplicate of this bug. ***