aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/xmenu.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index f5121e2bfed..12b76516e8c 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1416,6 +1416,7 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error)
1416 Position root_x, root_y; 1416 Position root_x, root_y;
1417 1417
1418 int first_pane; 1418 int first_pane;
1419 int next_release_must_exit = 0;
1419 1420
1420 *error = NULL; 1421 *error = NULL;
1421 1422
@@ -1655,16 +1656,27 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error)
1655 Vmouse_depressed = Qnil; 1656 Vmouse_depressed = Qnil;
1656 } 1657 }
1657 if (! (menu_item_selection == 0 1658 if (! (menu_item_selection == 0
1659 && !next_release_must_exit
1658 && (((XButtonEvent *) (&event))->time - last_event_timestamp 1660 && (((XButtonEvent *) (&event))->time - last_event_timestamp
1659 < XINT (Vdouble_click_time)))) 1661 < XINT (Vdouble_click_time))))
1660 break; 1662 break;
1663 /* Don't call XtDispatchEvent again for the same event! */
1664 continue;
1661 } 1665 }
1662 else if (event.type == ButtonPress) 1666 else if (event.type == ButtonPress)
1663 { 1667 {
1668 next_release_must_exit = 1;
1669#if 0
1670 XtDispatchEvent (&event);
1664 /* Any mouse button activity that doesn't select in the menu 1671 /* Any mouse button activity that doesn't select in the menu
1665 should unpost the menu. */ 1672 should unpost the menu. */
1666 if (menu_item_selection == 0) 1673 if (menu_item_selection == 0)
1667 break; 1674 break;
1675#endif
1676 /* Don't call XtDispatchEvent for the down event.
1677 Doing so seems to give strange results
1678 when you click on the menu bar while a menu is posted. */
1679 continue;
1668 } 1680 }
1669 else if (event.type == KeyPress) 1681 else if (event.type == KeyPress)
1670 { 1682 {