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 433593 - No keybindings to hide GtkComboBox popup window
No keybindings to hide GtkComboBox popup window
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkComboBox
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-04-26 13:09 UTC by Carlos Garnacho
Modified: 2007-05-18 11:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (4.78 KB, patch)
2007-04-26 13:10 UTC, Carlos Garnacho
committed Details | Review

Description Carlos Garnacho 2007-04-26 13:09:24 UTC
Right now the key combinations to hide the popup menu are either dependent from GtkMenuShell (in menu mode), or hardcoded in the treeview key-press-event handler (list mode), I'm attaching a patch to add such keybindings to GtkComboBox, and make the menu widgets forward the GdkEventKey to the combobox if they didn't handle it.
Comment 1 Carlos Garnacho 2007-04-26 13:10:27 UTC
Created attachment 87062 [details] [review]
patch
Comment 2 Matthias Clasen 2007-04-26 13:42:54 UTC
The idea looks fine to me. Out of interest, do you envision using anything
besides Up/Escape for popdown ?

But it appears that the "incredibly lame hack" has been lost ?

-      /* reset active item -- this is incredibly lame and ugly */
-      if (gtk_combo_box_get_active_iter (combo_box, &iter))
-	gtk_combo_box_set_active_iter (combo_box, &iter);
Comment 3 Carlos Garnacho 2007-04-26 14:18:06 UTC
Forgot to say that this patch is inspired in a maemo change, they use their Menu and Home keys to also popdown the menu, and besides that, I think it makes sense to have customizable keybindings for both popup and popdown.

Regarding that hack, I've been testing things and everything seemed to work fine, will investigate a bit more that change and comment here whether it's still necessary or not :)
Comment 4 Matthias Clasen 2007-04-30 16:38:56 UTC
Can I propose that we just add the hack back for now ?
Comment 5 Carlos Garnacho 2007-05-10 15:10:32 UTC
Yeah, doing that doesn't hurt indeed, but I've checked the source of this hack, and it almost takes me to the beginning of time (it's been there since the first commit in libegg/libegg/combo-old/eggcomboboxpicker.c [1]). I've also asked Kris and he doesn't seem to remember... IMHO there are many chances that the hack isn't needed anymore, after all the heavy code changes.

But anyways... will do a new patch with the hack back :)

[1] http://svn.gnome.org/viewcvs/libegg/trunk/libegg/combo-old/eggcomboboxpicker.c?revision=176&view=markup
Comment 6 Matthias Clasen 2007-05-10 23:39:24 UTC
I concur that a lame hack that nobody can remember the reason for is not worth keeping. And I couldn't spot any behaviour difference in some testing.

So feel free to rip it out.
Comment 7 Carlos Garnacho 2007-05-18 11:33:41 UTC
Thanks! I've just committed this to trunk :)

2007-05-18  Carlos Garnacho  <carlos@imendio.com>

        Make combobox menu popdown keybindable (#433593)

        * gtk/gtkcombobox.c (gtk_combo_box_class_init): Add "popdown" binding
        signal and keybindings.
        (gtk_combo_box_real_popdown): Added, "popdown" keybinding signal
        handler.
        (gtk_combo_box_menu_key_press):
        (gtk_combo_box_list_key_press): forward the event to the combobox if
        it wasn't handled by the menu.