diff options
author | Jan Djärv <jan.h.d@swipnet.se> | 2004-12-27 15:23:22 +0000 |
---|---|---|
committer | Jan Djärv <jan.h.d@swipnet.se> | 2004-12-27 15:23:22 +0000 |
commit | e89f4e4bd8bb43ecd709695deeb1957a5b39fcb6 (patch) | |
tree | d047ea33e1cf0f33d3d7a6528054cfd79097b574 /oldXMenu/Activate.c | |
parent | 4220b2a5cee38a736c2e5562bd6198d9e46847b4 (diff) | |
download | emacs-e89f4e4bd8bb43ecd709695deeb1957a5b39fcb6.tar.gz |
* Activate.c (XMenuActivate): Return XM_NO_SELECT if Escape or C-g
was pressed.
Diffstat (limited to 'oldXMenu/Activate.c')
-rw-r--r-- | oldXMenu/Activate.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/oldXMenu/Activate.c b/oldXMenu/Activate.c index 363b225a355..2f81299cbb6 100644 --- a/oldXMenu/Activate.c +++ b/oldXMenu/Activate.c @@ -81,6 +81,7 @@ #include <config.h> #include "XMenuInt.h" +#include <X11/keysym.h> /* For debug, set this to 0 to not grab the keyboard on menu popup */ int x_menu_grab_keyboard = 1; @@ -131,6 +132,7 @@ XMenuActivate(display, menu, p_num, s_num, x_pos, y_pos, event_mask, data, Window root, child; int root_x, root_y, win_x, win_y; unsigned int mask; + KeySym keysym; /* * Define and allocate a foreign event queue to hold events @@ -458,6 +460,18 @@ XMenuActivate(display, menu, p_num, s_num, x_pos, y_pos, event_mask, data, } selection = True; break; + case KeyPress: + case KeyRelease: + keysym = XLookupKeysym (&event.xkey, 0); + + /* Pop down on C-g and Escape. */ + if ((keysym == XK_g && (event.xkey.state & ControlMask) != 0) + || keysym == XK_Escape) /* Any escape, ignore modifiers. */ + { + ret_val = XM_NO_SELECT; + selection = True; + } + break; default: /* * If AEQ mode is enabled then queue the event. |