It does not happen on every click, but a majority of them.
Reverting the following change seems to remove the problem:
2010-07-03 Jan Djärv<jan.h.d@swipnet.se>
* xmenu.c (x_activate_menubar): Send Press/Release for Gtk+ to avoid
grab on just Press (Bug#6499).
I'll revert that then, but it can't be that change that is responsible
for the same beahviour in Motif menu bars.
NOT, NOT yet! Please read!
With a binary search I have found the breaking revision. It is rev.100770.
Indeed r100769 works as expected, r100700 NOT. Reverting the change to
xmenu.c, i.e. applying this patch
===========================
--- emacs-r100770/src/xmenu.c 2010-07-12 10:45:19.000000000 +0200
+++ emacs-r100769/src/xmenu.c 2010-07-12 10:20:51.000000000 +0200
@@ -676,14 +676,6 @@
set_frame_menubar (f, 0, 1);
BLOCK_INPUT;
#ifdef USE_GTK
- /* If we click outside any menu item, the menu bar still grabs.
- So we send Press and the Release. If outside, grab is released.
- If on a menu item, it is popped up normally.
- PutBack is like a stack, so we put back in reverse order. */
- f->output_data.x->saved_menu_event->type = ButtonRelease;
- XPutBackEvent (f->output_data.x->display_info->display,
- f->output_data.x->saved_menu_event);
- f->output_data.x->saved_menu_event->type = ButtonPress;
XPutBackEvent (f->output_data.x->display_info->display,
f->output_data.x->saved_menu_event);
popup_activated_flag = 1;
===========================
fix the problem for me!
As you can see, it regards GTK build (ifdef USE_GTK). Perhaps I understand the
motivations for the changes in xmenu.c, but they break something. It is
definitely a bug (better: a regression) for me. Since Emacs 22.0.50, I never
seen the problem I described nor in all my GTK builds.
Ciao,
Angelo.