On Fri, 26 Sep 2014 at 12:29:45 +0800, David Maciejak wrote:
> This patch is setting the default close keybinding
> in switch panel if any instead of the hardcoded esc key.
What's the point of this?
ESC is pretty standard, and I don't see much reason why one
would want to change it. Furthermore, I prefer the naming
'escapeKey' instead of 'closeKey' because 'close' is associated
to ending applications, which is not the meaning here.
>
> ---
> src/cycling.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/src/cycling.c b/src/cycling.c
> index cdd4377..a2c88b3 100644
> --- a/src/cycling.c
> +++ b/src/cycling.c
> @@ -87,8 +87,8 @@ void StartWindozeCycle(WWindow *wwin, XEvent *event,
> Bool next, Bool class_only)
> KeyCode endKey = XKeysymToKeycode(dpy, XK_End);
> 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);
> + KeyCode closeKey = wKeyBindings[WKBD_CLOSE].keycode;
> Bool esc_cancel = False;
> Bool somethingElse = False;
> Bool done = False;
> @@ -102,6 +102,9 @@ void StartWindozeCycle(WWindow *wwin, XEvent
> *event, Bool next, Bool class_only)
> if (!wwin)
> return;
>
> + if (closeKey == 0)
> + closeKey = XKeysymToKeycode(dpy, XK_Escape);
> +
> if (next) {
> if (class_only)
> binding = wKeyBindings[WKBD_GROUPNEXT];
> @@ -172,7 +175,7 @@ void StartWindozeCycle(WWindow *wwin, XEvent
> *event, Bool next, Bool class_only)
> newFocused = wSwitchPanelSelectFirst(swpanel, ev.xkey.keycode != homeKey);
> oldFocused = change_focus_and_raise(newFocused, oldFocused, swpanel,
> scr, False);
>
> - } else if (ev.xkey.keycode == escapeKey) {
> + } else if (ev.xkey.keycode == closeKey) {
>
> /* Focus the first window of the swpanel, despite the 'False' */
> newFocused = wSwitchPanelSelectFirst(swpanel, False);
--
To unsubscribe, send mail to [email protected].