From: Jan D Date: Sat, 3 Jul 2010 09:38:44 +0000 (+0200) Subject: Fix hang for mouse press on menubar but not on an item (Bug#6499). X-Git-Tag: emacs-pretest-23.2.90~139^2~71 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ad3e6f4474d2737be89456332319e8efbdb382c4;p=emacs.git Fix hang for mouse press on menubar but not on an item (Bug#6499). * xmenu.c (x_activate_menubar): Send Press/Release for Gtk+ to avoid grab on just Press (Bug#6499). --- diff --git a/src/ChangeLog b/src/ChangeLog index 77581160a0e..59f953bcc69 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-07-03 Jan Djärv + + * xmenu.c (x_activate_menubar): Send Press/Release for Gtk+ to avoid + grab on just Press (Bug#6499). + 2010-07-02 Chong Yidong * frame.c (Qtooltip): New var. diff --git a/src/xmenu.c b/src/xmenu.c index 64e55b7413c..a9158b750e3 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -684,6 +684,14 @@ x_activate_menubar (f) 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;