After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 688738 - GtkMenuButton problem with mnemonics / accelerators
GtkMenuButton problem with mnemonics / accelerators
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-11-20 17:05 UTC by David Zeuthen (not reading bugmail)
Modified: 2013-08-19 02:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (981 bytes, application/x-zip-compressed)
2013-08-17 09:41 UTC, LE GARREC Vincent
Details

Description David Zeuthen (not reading bugmail) 2012-11-20 17:05:29 UTC
If you activate a GtkMenuButton by a mnemonic or accelerator, it will not show the menu. However if you've clicked it one time before - thus showing the menu - it'll work. gtk3-3.6.2-1.fc18.x86_64

To easily reproduce just try the Disks application in gnome-disk-utility. Just hit F10 once the main window shows - it's the accelerator for the gear menu-button.
Comment 1 Matthias Clasen 2012-11-21 10:31:36 UTC
f10 doesn't seem to work here, regardless of whether the menu was shown before or not.
Comment 2 David Zeuthen (not reading bugmail) 2012-11-21 10:58:49 UTC
(In reply to comment #1)
> f10 doesn't seem to work here, regardless of whether the menu was shown before
> or not.

Make sure you're using master, the F10 accelerator was added Nov 16 2012.
Comment 3 Matthias Clasen 2012-11-22 03:05:20 UTC
hmm, haven't tried git gnome-disks, but it seems to work fine in my simple test case.
Comment 4 David Zeuthen (not reading bugmail) 2013-06-04 02:39:31 UTC
Could this be related to the fact that GTK+ itself is using F10 for the application menu? I just noticed this when running my application on XQuartz and tunneled through X11...

The decision for GTK+ to do that (steal F10 for the application menu) doesn't seem to jive well with the guidelines in https://live.gnome.org/GnomeOS/Design/Whiteboards/KeyboardShortcuts ...
Comment 5 LE GARREC Vincent 2013-08-17 09:41:27 UTC
Created attachment 251986 [details]
test case

I'm using GTK+3.8.2 and I still have this bug.

Please find enclose a test case that doesn't work.
If you press Alt+s the button is press but the menu doesn't show. If you click with the mouse then press Alt+s, it's working.

In the "builder.ui", if you change the visible property of the GtkMenu to False, the problem disappear.

I think the problem come from gtk_menu_button_toggled because of the line :
  if (gtk_toggle_button_get_active (button) &&
      !gtk_widget_get_visible (GTK_WIDGET (priv->popup)))
so if the menu is visible, nothing's done. This test is not in the "button_press_event" event.

An easy way is to add a "gtk_widget_hide (GTK_WIDGET (priv->popup));" right after the gtk_menu_attach_to_widget in the function _gtk_menu_button_set_popup_with_func.