diff options
| author | Jan Djärv | 2004-12-27 15:23:22 +0000 |
|---|---|---|
| committer | Jan Djärv | 2004-12-27 15:23:22 +0000 |
| commit | e89f4e4bd8bb43ecd709695deeb1957a5b39fcb6 (patch) | |
| tree | d047ea33e1cf0f33d3d7a6528054cfd79097b574 | |
| parent | 4220b2a5cee38a736c2e5562bd6198d9e46847b4 (diff) | |
| download | emacs-e89f4e4bd8bb43ecd709695deeb1957a5b39fcb6.tar.gz emacs-e89f4e4bd8bb43ecd709695deeb1957a5b39fcb6.zip | |
* Activate.c (XMenuActivate): Return XM_NO_SELECT if Escape or C-g
was pressed.
| -rw-r--r-- | oldXMenu/Activate.c | 14 | ||||
| -rw-r--r-- | oldXMenu/ChangeLog | 5 |
2 files changed, 19 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 @@ | |||
| 81 | 81 | ||
| 82 | #include <config.h> | 82 | #include <config.h> |
| 83 | #include "XMenuInt.h" | 83 | #include "XMenuInt.h" |
| 84 | #include <X11/keysym.h> | ||
| 84 | 85 | ||
| 85 | /* For debug, set this to 0 to not grab the keyboard on menu popup */ | 86 | /* For debug, set this to 0 to not grab the keyboard on menu popup */ |
| 86 | int x_menu_grab_keyboard = 1; | 87 | int x_menu_grab_keyboard = 1; |
| @@ -131,6 +132,7 @@ XMenuActivate(display, menu, p_num, s_num, x_pos, y_pos, event_mask, data, | |||
| 131 | Window root, child; | 132 | Window root, child; |
| 132 | int root_x, root_y, win_x, win_y; | 133 | int root_x, root_y, win_x, win_y; |
| 133 | unsigned int mask; | 134 | unsigned int mask; |
| 135 | KeySym keysym; | ||
| 134 | 136 | ||
| 135 | /* | 137 | /* |
| 136 | * Define and allocate a foreign event queue to hold events | 138 | * 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, | |||
| 458 | } | 460 | } |
| 459 | selection = True; | 461 | selection = True; |
| 460 | break; | 462 | break; |
| 463 | case KeyPress: | ||
| 464 | case KeyRelease: | ||
| 465 | keysym = XLookupKeysym (&event.xkey, 0); | ||
| 466 | |||
| 467 | /* Pop down on C-g and Escape. */ | ||
| 468 | if ((keysym == XK_g && (event.xkey.state & ControlMask) != 0) | ||
| 469 | || keysym == XK_Escape) /* Any escape, ignore modifiers. */ | ||
| 470 | { | ||
| 471 | ret_val = XM_NO_SELECT; | ||
| 472 | selection = True; | ||
| 473 | } | ||
| 474 | break; | ||
| 461 | default: | 475 | default: |
| 462 | /* | 476 | /* |
| 463 | * If AEQ mode is enabled then queue the event. | 477 | * If AEQ mode is enabled then queue the event. |
diff --git a/oldXMenu/ChangeLog b/oldXMenu/ChangeLog index ab86c364736..31a786cc23a 100644 --- a/oldXMenu/ChangeLog +++ b/oldXMenu/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2004-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * Activate.c (XMenuActivate): Return XM_NO_SELECT if Escape or C-g | ||
| 4 | was pressed. | ||
| 5 | |||
| 1 | 2004-11-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 6 | 2004-11-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2 | 7 | ||
| 3 | * XMenu.h (XMenuActivateSetWaitFunction): New function. | 8 | * XMenu.h (XMenuActivateSetWaitFunction): New function. |