From c9937f6f6a060284f7430da2901e53be6a9d4c26 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 22 Apr 2013 10:49:45 +0100 Subject: [PATCH] Fix StartWindozeCycle() shift key behaviour. As the name implies, StartWindozeCycle() cycles windows in the same way that a popular commercially-available operating system does. However Window Maker's handling of the shift key in the switchpanel does not currently mirror that of its commercial counterpart. In the popular operating system: Holding alt and shift then pressing and releasing tab will highlight the previous window in the switcher. Releasing shift with alt still held will not close the switcher. The window change is commited when alt is released. In Window Maker: Holding alt and shift then pressing and releasing tab will highlight the previous window in the switchpanel. Releasing shift with alt still held will close the switchpanel and commit the window change. This patch adds the StrictWindozeCycle boolean preference. When it is set to YES the switchpanel will remain open as long as alt is held even if shift is pressed and released. --- src/WindowMaker.h | 1 + src/cycling.c | 4 ++++ src/defaults.c | 2 ++ 3 files changed, 7 insertions(+) diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 50d5dc27..bc034d93 100644 --- a/src/WindowMaker.h +++ b/src/WindowMaker.h @@ -418,6 +418,7 @@ typedef struct WPreferences { int history_lines; /* history of "Run..." dialog */ char cycle_active_head_only; /* Cycle only windows on the active head */ char cycle_ignore_minimized; /* Ignore minimized windows when cycling */ + char strict_windoze_cycle; /* don't close switchpanel when shift is released */ /* All delays here are in ms. 0 means instant auto-action. */ int clip_auto_raise_delay; /* Delay after which the clip will be raised when entered */ diff --git a/src/cycling.c b/src/cycling.c index b2c77268..a2168d6c 100644 --- a/src/cycling.c +++ b/src/cycling.c @@ -191,6 +191,10 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool next, Bool class_onl case KeyRelease: + if (ev.xkey.keycode == shiftLKey || ev.xkey.keycode == shiftRKey) + if (wPreferences.strict_windoze_cycle) + break; + for (i = 0; i < 8 * keymap->max_keypermod; i++) { int mask = 1 << (i / keymap->max_keypermod); diff --git a/src/defaults.c b/src/defaults.c index 53d81734..748f839c 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -474,6 +474,8 @@ WDefaultEntry optionList[] = { &wPreferences.dont_blink, getBool, NULL, NULL, NULL}, {"SingleClickLaunch", "NO", NULL, &wPreferences.single_click, getBool, NULL, NULL, NULL}, + {"StrictWindozeCycle", "NO", NULL, + &wPreferences.strict_windoze_cycle, getBool, NULL, NULL, NULL}, /* style options */ -- 2.11.4.GIT