GNOME Bugzilla – Bug 155336
Menu items without submenu in menu bar
Last modified: 2012-01-26 02:23:04 UTC
Please describe the problem: a top level menu item without sub menus in a gtk_item_factory needs two clicks to be activated with gtk 2.4.7 or higher and only one click with gtk 2.2.4 Steps to reproduce: a small test program is added in the report try to clik on the OK button Actual results: two clicks are needed to activate the handler of the OK button Expected results: I would prefer just one as it was the case with older versions of gtk Does this happen every time? yes Other information:
Created attachment 32582 [details] a small test program to illustrate the bug
Created attachment 32583 [details] Test program extracted out of tarball
I doubt this actually has anything to do with GtkItemFactory; most likely it applies to any menuitem without a submenu in a menubar. I'd tend to agree it is a bug, though fixing it might require some special casing. You'd have to be careful that the right behavior got preserved for keynav inside the menu ... keynaving to the item definitely shouldn't activate it immediately.
(BTW, if you are wondering about extracting the test program out of the tarball, I have a directory where I dump test programs with a Makefile === CFLAGS=`pkg-config --cflags gtk+-2.0` -g -Wall -O2 LDFLAGS=`pkg-config --libs gtk+-2.0` === so I can just save a single test file into that directory as, say, chancelier.c and do 'make chancelier'. I suspect other GTK+ developers have similar.)
Please note that you don't really need two clicks to activate a menuitem without submenu in a menubar, a long click also activates the menuitem.
I don't think a fix for this is going to happen. submenu-less items in menubars are simply not supported.