aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1996-07-07 22:46:15 +0000
committerKarl Heuer1996-07-07 22:46:15 +0000
commit106240057834db0bd7a1c9092b248dd532c68c79 (patch)
tree35a4e6d075f711da275b7b1b6af5e3937d7cae55 /src
parent3c8feb4a2075ea76577efd18928d686da61f9bb3 (diff)
downloademacs-106240057834db0bd7a1c9092b248dd532c68c79.tar.gz
emacs-106240057834db0bd7a1c9092b248dd532c68c79.zip
(popup_get_selection): For a ButtonRelease on the proper
display, don't queue it, and always deactivate the menu.
Diffstat (limited to 'src')
-rw-r--r--src/xmenu.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index e801cc31351..962c3717299 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1096,10 +1096,15 @@ popup_get_selection (initial_event, dpyinfo, id)
1096 /* Handle expose events for editor frames right away. */ 1096 /* Handle expose events for editor frames right away. */
1097 if (event.type == Expose) 1097 if (event.type == Expose)
1098 process_expose_from_menu (event); 1098 process_expose_from_menu (event);
1099 /* Make sure we don't consider buttons grabbed after menu goes. */ 1099 /* Make sure we don't consider buttons grabbed after menu goes.
1100 And make sure to deactivate for any ButtonRelease,
1101 even if XtDispatchEvent doesn't do that. */
1100 else if (event.type == ButtonRelease 1102 else if (event.type == ButtonRelease
1101 && dpyinfo->display == event.xbutton.display) 1103 && dpyinfo->display == event.xbutton.display)
1102 dpyinfo->grabbed &= ~(1 << event.xbutton.button); 1104 {
1105 dpyinfo->grabbed &= ~(1 << event.xbutton.button);
1106 popup_activated_flag = 0;
1107 }
1103 /* If the user presses a key, deactivate the menu. 1108 /* If the user presses a key, deactivate the menu.
1104 The user is likely to do that if we get wedged. */ 1109 The user is likely to do that if we get wedged. */
1105 else if (event.type == KeyPress 1110 else if (event.type == KeyPress
@@ -1118,11 +1123,13 @@ popup_get_selection (initial_event, dpyinfo, id)
1118 } 1123 }
1119 1124
1120 /* Queue all events not for this popup, 1125 /* Queue all events not for this popup,
1121 except for Expose, which we've already handled. 1126 except for Expose, which we've already handled, and ButtonRelease.
1122 Note that the X window is associated with the frame if this 1127 Note that the X window is associated with the frame if this
1123 is a menu bar popup, but not if it's a dialog box. So we use 1128 is a menu bar popup, but not if it's a dialog box. So we use
1124 x_non_menubar_window_to_frame, not x_any_window_to_frame. */ 1129 x_non_menubar_window_to_frame, not x_any_window_to_frame. */
1125 if (event.type != Expose 1130 if (event.type != Expose
1131 && !(event.type == ButtonRelease
1132 && dpyinfo->display == event.xbutton.display)
1126 && (event.xany.display != dpyinfo->display 1133 && (event.xany.display != dpyinfo->display
1127 || x_non_menubar_window_to_frame (dpyinfo, event.xany.window))) 1134 || x_non_menubar_window_to_frame (dpyinfo, event.xany.window)))
1128 { 1135 {