GNOME Bugzilla – Bug 695380
gtk_binding_entry_skip broken
Last modified: 2013-04-17 11:23:02 UTC
Created attachment 238330 [details] [review] patch Steps to repro: In gnome-terminal, uncheck the "enable menubar accel" setting from the keybindings dialogue (on <= 3.6; or in prefs dialogue, general tab, on 3.7). Now in the terminal, press Shift-F10. Expected results: Shift-F10 does not pop up the context menu; the key event is passed to the terminal application (prints some escape sequence). Actual results: Shift-F10 both emits the escape sequence *and* the popup menu is opened. Analysis: gnome-terminal uses gtk_binding_entry_skip to skip the Shift-F10 binding. Breaking on terminal_screen_popup_menu to find out where the menu popup comes from, we get this: (gdb) where
+ Trace 231606
In frame #9, we have a list of GtkBindingEntry's of length 12: (gdb) p entries $1 = (GSList *) 0x838db00 (gdb) p g_list_length(entries) $3 = 12 (gdb) p *((GtkBindingEntry*)g_list_nth_data(entries, 0)) $9 = {keyval = 65479, modifiers = GDK_SHIFT_MASK, binding_set = 0x82bad20, destroyed = 0, in_emission = 0, marks_unbound = 1, set_next = 0x0, hash_next = 0x80a6ec0, signals = 0x0} (gdb) p *((GtkBindingEntry*)g_list_nth_data(entries, 1)) As you can see, the entry has marks_unbound which marks this as a 'skip' entry, and all the other entries shouldn't cause a binding activation. (The popup-menu entries are elements 8..11 of the entry list.) However, activation nevertheless happens. I think this broke in commit 9a3466832cc73ae29b704547747b8699132c1250 where the "if (unbound) break;" code was removed from the loop in gtk_bindings_activate_list(). Attaching the (untested since I currently can't compile gtk+) patch.
I have tested the patch now and it fixes the bug.
Pushed to master with OK from mclasen on #gtk+.