diff options
author | Karl Heuer <kwzh@gnu.org> | 1996-07-07 22:46:15 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1996-07-07 22:46:15 +0000 |
commit | 106240057834db0bd7a1c9092b248dd532c68c79 (patch) | |
tree | 35a4e6d075f711da275b7b1b6af5e3937d7cae55 /src/xmenu.c | |
parent | 3c8feb4a2075ea76577efd18928d686da61f9bb3 (diff) | |
download | emacs-106240057834db0bd7a1c9092b248dd532c68c79.tar.gz |
(popup_get_selection): For a ButtonRelease on the proper
display, don't queue it, and always deactivate the menu.
Diffstat (limited to 'src/xmenu.c')
-rw-r--r-- | src/xmenu.c | 13 |
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) /* Handle expose events for editor frames right away. */ if (event.type == Expose) process_expose_from_menu (event); - /* Make sure we don't consider buttons grabbed after menu goes. */ + /* Make sure we don't consider buttons grabbed after menu goes. + And make sure to deactivate for any ButtonRelease, + even if XtDispatchEvent doesn't do that. */ else if (event.type == ButtonRelease && dpyinfo->display == event.xbutton.display) - dpyinfo->grabbed &= ~(1 << event.xbutton.button); + { + dpyinfo->grabbed &= ~(1 << event.xbutton.button); + popup_activated_flag = 0; + } /* If the user presses a key, deactivate the menu. The user is likely to do that if we get wedged. */ else if (event.type == KeyPress @@ -1118,11 +1123,13 @@ popup_get_selection (initial_event, dpyinfo, id) } /* Queue all events not for this popup, - except for Expose, which we've already handled. + except for Expose, which we've already handled, and ButtonRelease. Note that the X window is associated with the frame if this is a menu bar popup, but not if it's a dialog box. So we use x_non_menubar_window_to_frame, not x_any_window_to_frame. */ if (event.type != Expose + && !(event.type == ButtonRelease + && dpyinfo->display == event.xbutton.display) && (event.xany.display != dpyinfo->display || x_non_menubar_window_to_frame (dpyinfo, event.xany.window))) { |