mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
Handle Return in switchpanel.
Explicitly match a Return keypress in the switchpanel, so that the currently selected window is focused without the keypress event being handled elsewhere. Pressing Return to commit the window selection is intuitive but other shortcuts may bind Return. Any keypress not explicitly handled in the switchpanel code will be passed through to other shortcut processing. If, for example, alt+return were mapped to Select Window and the switchpanel is open, pressing return while holding alt would both commit the window change AND select the window, which is not intuitive.
This commit is contained in:
committed by
Carlos R. Mafra
parent
a6b1833b41
commit
ae91ee4b0a
@@ -92,6 +92,7 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool next, Bool class_onl
|
||||
KeyCode shiftLKey = XKeysymToKeycode(dpy, XK_Shift_L);
|
||||
KeyCode shiftRKey = XKeysymToKeycode(dpy, XK_Shift_R);
|
||||
KeyCode escapeKey = XKeysymToKeycode(dpy, XK_Escape);
|
||||
KeyCode returnKey = XKeysymToKeycode(dpy, XK_Return);
|
||||
Bool esc_cancel = False;
|
||||
Bool somethingElse = False;
|
||||
Bool done = False;
|
||||
@@ -189,6 +190,11 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool next, Bool class_onl
|
||||
esc_cancel = True;
|
||||
done = True;
|
||||
|
||||
} else if (ev.xkey.keycode == returnKey) {
|
||||
|
||||
/* Close the switchpanel without eating the keypress */
|
||||
done = True;
|
||||
|
||||
} else if (ev.xkey.keycode != shiftLKey && ev.xkey.keycode != shiftRKey) {
|
||||
|
||||
somethingElse = True;
|
||||
@@ -202,6 +208,9 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool next, Bool class_onl
|
||||
if (wPreferences.strict_windoze_cycle)
|
||||
break;
|
||||
|
||||
if (ev.xkey.keycode == XK_Return)
|
||||
break;
|
||||
|
||||
for (i = 0; i < 8 * keymap->max_keypermod; i++) {
|
||||
|
||||
int mask = 1 << (i / keymap->max_keypermod);
|
||||
|
||||
Reference in New Issue
Block a user