summaryrefslogtreecommitdiff
path: root/src/xmenu.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-08-14 00:42:40 +0000
committerRichard M. Stallman <rms@gnu.org>1994-08-14 00:42:40 +0000
commitbc6a9d2234cd1b0917a14d69ce795d24b9e18ba3 (patch)
tree2b55491995fa13f0b23efcceec7a4ee5f9caf796 /src/xmenu.c
parentbdadfa8c40267c74074bc5ee7614dd826e48a5ee (diff)
downloademacs-bc6a9d2234cd1b0917a14d69ce795d24b9e18ba3.tar.gz
(xmenu_show): Unconditionally update x_mouse_grabbed and Vmouse_depressed.
Diffstat (limited to 'src/xmenu.c')
-rw-r--r--src/xmenu.c22
1 files changed, 12 insertions, 10 deletions
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