diff options
| author | Jan Djärv | 2004-12-27 20:34:03 +0000 |
|---|---|---|
| committer | Jan Djärv | 2004-12-27 20:34:03 +0000 |
| commit | 33385c6fa06f2a9faef28252cd2e073b11e84c20 (patch) | |
| tree | 110b797d0bcf24977e2475ff2d3622aaf645a979 /src/xmenu.c | |
| parent | e2a57f28903ea556dd4e7594f1a95e5f290c95af (diff) | |
| download | emacs-33385c6fa06f2a9faef28252cd2e073b11e84c20.tar.gz emacs-33385c6fa06f2a9faef28252cd2e073b11e84c20.zip | |
* xmenu.c (popup_get_selection): Only pop down dialogs
on C-g and Escape.
Diffstat (limited to 'src/xmenu.c')
| -rw-r--r-- | src/xmenu.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index 55c28d831e8..ba4177fab67 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -1232,25 +1232,16 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers, down_on_keypress) | |||
| 1232 | event.xbutton.state = 0; | 1232 | event.xbutton.state = 0; |
| 1233 | #endif | 1233 | #endif |
| 1234 | } | 1234 | } |
| 1235 | /* If the user presses a key that doesn't go to the menu, | 1235 | /* Pop down on C-g and Escape. */ |
| 1236 | deactivate the menu. | ||
| 1237 | The user is likely to do that if we get wedged. | ||
| 1238 | All toolkits now pop down menus on ESC. | ||
| 1239 | For dialogs however, the focus may not be on the dialog, so | ||
| 1240 | in that case, we pop down. */ | ||
| 1241 | else if (event.type == KeyPress | 1236 | else if (event.type == KeyPress |
| 1242 | && down_on_keypress | 1237 | && down_on_keypress |
| 1243 | && dpyinfo->display == event.xbutton.display) | 1238 | && dpyinfo->display == event.xbutton.display) |
| 1244 | { | 1239 | { |
| 1245 | KeySym keysym = XLookupKeysym (&event.xkey, 0); | 1240 | KeySym keysym = XLookupKeysym (&event.xkey, 0); |
| 1246 | 1241 | ||
| 1247 | /* Pop down on C-g. */ | 1242 | if ((keysym == XK_g && (event.xkey.state & ControlMask) != 0) |
| 1248 | if (keysym == XK_g && (event.xkey.state & ControlMask) != 0) | 1243 | || keysym == XK_Escape) /* Any escape, ignore modifiers. */ |
| 1249 | popup_activated_flag = 0; | 1244 | popup_activated_flag = 0; |
| 1250 | |||
| 1251 | if (!IsModifierKey (keysym) | ||
| 1252 | && x_any_window_to_frame (dpyinfo, event.xany.window) != NULL) | ||
| 1253 | popup_activated_flag = 0; | ||
| 1254 | } | 1245 | } |
| 1255 | 1246 | ||
| 1256 | x_dispatch_event (&event, event.xany.display); | 1247 | x_dispatch_event (&event, event.xany.display); |