GNOME Bugzilla – Bug 686755
Pressing F10 should close the gear menu if it's open
Last modified: 2013-02-20 11:03:53 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.
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.
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)) { ... }
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.
Review of attachment 236586 [details] [review]: Looks good.
Opened a new bug in Gtk+ bug 694160
Pushed to master.