diff options
| author | Richard M. Stallman | 1994-08-28 07:39:12 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-08-28 07:39:12 +0000 |
| commit | 03b78673fb71aa01a455624ae2a841c7dd1b8767 (patch) | |
| tree | 75e97c564973ccc640ca4c1b5465053512032c4e /src | |
| parent | f7d786d0cb3cdaa61c10dfcbf0180192e4d75938 (diff) | |
| download | emacs-03b78673fb71aa01a455624ae2a841c7dd1b8767.tar.gz emacs-03b78673fb71aa01a455624ae2a841c7dd1b8767.zip | |
(xmenu_show): Don't queue events that are in the menu bar.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xmenu.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index 8716d96c6d9..1adf12fbcc0 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -1650,7 +1650,7 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error) | |||
| 1650 | { | 1650 | { |
| 1651 | XEvent event; | 1651 | XEvent event; |
| 1652 | int queue_and_exit = 0; | 1652 | int queue_and_exit = 0; |
| 1653 | int in_this_menu; | 1653 | int in_this_menu = 0, in_menu_bar = 0; |
| 1654 | Widget widget; | 1654 | Widget widget; |
| 1655 | 1655 | ||
| 1656 | XtAppNextEvent (Xt_app_con, &event); | 1656 | XtAppNextEvent (Xt_app_con, &event); |
| @@ -1658,7 +1658,7 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error) | |||
| 1658 | /* Check whether the event happened in the menu | 1658 | /* Check whether the event happened in the menu |
| 1659 | or any child of it. */ | 1659 | or any child of it. */ |
| 1660 | widget = XtWindowToWidget (XDISPLAY event.xany.window); | 1660 | widget = XtWindowToWidget (XDISPLAY event.xany.window); |
| 1661 | in_this_menu = 0; | 1661 | |
| 1662 | while (widget) | 1662 | while (widget) |
| 1663 | { | 1663 | { |
| 1664 | if (widget == menu) | 1664 | if (widget == menu) |
| @@ -1666,6 +1666,11 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error) | |||
| 1666 | in_this_menu = 1; | 1666 | in_this_menu = 1; |
| 1667 | break; | 1667 | break; |
| 1668 | } | 1668 | } |
| 1669 | if (widget == f->display.x->menubar_widget) | ||
| 1670 | { | ||
| 1671 | in_menu_bar = 1; | ||
| 1672 | break; | ||
| 1673 | } | ||
| 1669 | widget = XtParent (widget); | 1674 | widget = XtParent (widget); |
| 1670 | } | 1675 | } |
| 1671 | 1676 | ||
| @@ -1742,7 +1747,7 @@ xmenu_show (f, x, y, menubarp, keymaps, title, error) | |||
| 1742 | 1747 | ||
| 1743 | XtDispatchEvent (&event); | 1748 | XtDispatchEvent (&event); |
| 1744 | 1749 | ||
| 1745 | if (queue_and_exit || !in_this_menu) | 1750 | if (queue_and_exit || (!in_this_menu && !in_menu_bar)) |
| 1746 | { | 1751 | { |
| 1747 | queue_tmp | 1752 | queue_tmp |
| 1748 | = (struct event_queue *) malloc (sizeof (struct event_queue)); | 1753 | = (struct event_queue *) malloc (sizeof (struct event_queue)); |