Commit e89f4e4b authored by Jan Djärv's avatar Jan Djärv
Browse files

* Activate.c (XMenuActivate): Return XM_NO_SELECT if Escape or C-g

was pressed.
parent 4220b2a5
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
#include <config.h> #include <config.h>
#include "XMenuInt.h" #include "XMenuInt.h"
#include <X11/keysym.h>
/* For debug, set this to 0 to not grab the keyboard on menu popup */ /* For debug, set this to 0 to not grab the keyboard on menu popup */
int x_menu_grab_keyboard = 1; 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,6 +132,7 @@ XMenuActivate(display, menu, p_num, s_num, x_pos, y_pos, event_mask, data,
Window root, child; Window root, child;
int root_x, root_y, win_x, win_y; int root_x, root_y, win_x, win_y;
unsigned int mask; unsigned int mask;
KeySym keysym;
/* /*
* Define and allocate a foreign event queue to hold events * 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,6 +460,18 @@ XMenuActivate(display, menu, p_num, s_num, x_pos, y_pos, event_mask, data,
} }
selection = True; selection = True;
break; 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: default:
/* /*
* If AEQ mode is enabled then queue the event. * If AEQ mode is enabled then queue the event.
......
2004-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* Activate.c (XMenuActivate): Return XM_NO_SELECT if Escape or C-g
was pressed.
2004-11-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 2004-11-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* XMenu.h (XMenuActivateSetWaitFunction): New function. * XMenu.h (XMenuActivateSetWaitFunction): New function.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment