From: Richard M. Stallman Date: Sun, 14 Aug 1994 00:42:40 +0000 (+0000) Subject: (xmenu_show): Unconditionally update x_mouse_grabbed and Vmouse_depressed. X-Git-Tag: emacs-19.34~7314 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9f9e1ff837973aacbe0fe572e9aebb6b02be91c7;p=emacs.git (xmenu_show): Unconditionally update x_mouse_grabbed and Vmouse_depressed. --- diff --git a/src/xmenu.c b/src/xmenu.c index 0c03019f07e..2ca8eddcb4e 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1655,16 +1655,18 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error) if (event.type == ButtonRelease) { XtDispatchEvent (&event); - if (! menubarp) - { - /* Do the work of construct_mouse_click since it can't - be called. Initially, the popup menu has been called - from a ButtonPress in the edit_widget. Then the mouse - has been set to grabbed. Reset it now. */ - x_mouse_grabbed &= ~(1 << event.xbutton.button); - if (!x_mouse_grabbed) - Vmouse_depressed = Qnil; - } + + /* Do the work of construct_mouse_click since it can't + be called. Initially, the popup menu has been called + from a ButtonPress in the edit_widget. Then the mouse + has been set to grabbed. Reset it now. */ + x_mouse_grabbed &= ~(1 << event.xbutton.button); + if (!x_mouse_grabbed) + Vmouse_depressed = Qnil; + + /* If we release the button soon without selecting anything, + stay in the loop--that is, leave the menu posted. + Otherwise, exit this loop and thus pop down the menu. */ if (! (menu_item_selection == 0 && !next_release_must_exit && (((XButtonEvent *) (&event))->time - last_event_timestamp