diff options
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/xmenu.c | 15 |
2 files changed, 8 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index eafd381817f..f016801fd96 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2004-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * xmenu.c (popup_get_selection): Only pop down dialogs | ||
| 4 | on C-g and Escape. | ||
| 5 | |||
| 1 | 2004-12-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 6 | 2004-12-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 2 | 7 | ||
| 3 | * dispextern.h: Change HAVE_CARBON to MAC_OS. | 8 | * dispextern.h: Change HAVE_CARBON to MAC_OS. |
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); |