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 686755 - Pressing F10 should close the gear menu if it's open
Pressing F10 should close the gear menu if it's open
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Keyboardability
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-10-24 05:04 UTC by Jeremy Bicha
Modified: 2013-02-20 11:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
toolbar: Toggle the gear menu off when F10 is pressed again (1.65 KB, patch)
2013-02-07 19:47 UTC, Michael Wood
reviewed Details | Review
toolbar: Toggle the gear menu off when F10 is pressed again (1.75 KB, patch)
2013-02-18 13:12 UTC, Michael Wood
accepted-commit_now Details | Review

Description Jeremy Bicha 2012-10-24 05:04:06 UTC
F10 opens the gear menu, but pressing F10 a second time doesn't close the gear menu like I would expect.

This also affects epiphany.
Comment 1 Michael Wood 2013-02-07 19:47:15 UTC
Created attachment 235440 [details] [review]
toolbar: Toggle the gear menu off when F10 is pressed again

The GtkMenu gets the key focus so the F10 action associated with the window
doesn't get run so listen to the key event on the widget it's self just
for closing.
Comment 2 Cosimo Cecchi 2013-02-17 15:39:31 UTC
Review of attachment 235440 [details] [review]:

Overall I feel like this should somehow handled better by GTK itself. The menu button could internally check if there are any accelerators associated with its' action name (as specified by GtkActionable) and listen for those on the menu it's set - feel like trying to implement this in GTK? :)
In any case, if we don't get the GTK fix, this also sounds reasonable with this comment fixed.

::: src/nautilus-toolbar.c
@@ +386,3 @@
+                     GdkEventKey *event,
+                     gpointer user_data)
+{

This will still match e.g. Ctrl+F10 or Shift+F10, which might be associated to a menu action.
I'd probably check for (event->state == 0) in addition, or do something like

GdkModifierType mask = gtk_accelerator_get_default_mod_mask();
if ((event->state & mask) == 0 && (event->keyval == GDK_KEY_F10)) {
 ...
}
Comment 3 Michael Wood 2013-02-18 13:12:21 UTC
Created attachment 236586 [details] [review]
toolbar: Toggle the gear menu off when F10 is pressed again

Thanks.

I agree, would be nicer if Gtk handled this, I will have a look at fixing this in Gtk.
Comment 4 Cosimo Cecchi 2013-02-18 19:43:07 UTC
Review of attachment 236586 [details] [review]:

Looks good.
Comment 5 Michael Wood 2013-02-19 11:59:06 UTC
Opened a new bug in Gtk+ bug 694160
Comment 6 Lionel Landwerlin 2013-02-20 11:03:53 UTC
Pushed to master.