This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project wmaker-crm.git.
The branch, next has been updated via 94777b97156db1a2bcdfcc8fd486fcc79b0bd7f7 (commit) via 8cb6a787264cc0adef2c82af0897ba8b8461783d (commit) via 6fb2b13ec708b74d24377c96703793c1360d7659 (commit) via 90675a6f048fef9663e28f74022c2ca4f7da0c9e (commit) via c9937f6f6a060284f7430da2901e53be6a9d4c26 (commit) from 29a526748553e11a1bcd7400e4cfc16c1f5351ed (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://repo.or.cz/w/wmaker-crm.git/commit/94777b97156db1a2bcdfcc8fd486fcc79b0bd7f7 commit 94777b97156db1a2bcdfcc8fd486fcc79b0bd7f7 Author: Iain Patterson <w...@iain.cx> Date: Mon Apr 22 14:03:14 2013 +0100 Support for same-class cycling in open switchpanel. If the switchpanel was opened with either FocusNextKey or FocusPrevKey shortcut, and the user presses GroupNextKey or GroupPrevKey, skip over windows of a different class when cycling through windows in the switchpanel. In the case where the switchpanel was opened with FocusNextKey or FocusPrevKey initially, the check can be skipped because all the available choices are necessarily of the same class already. diff --git a/src/cycling.c b/src/cycling.c index f989554..574e0f4 100644 --- a/src/cycling.c +++ b/src/cycling.c @@ -130,7 +130,7 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool next, Bool class_onl if (swpanel) { if (wwin->flags.mapped) - newFocused = wSwitchPanelSelectNext(swpanel, !next, True); + newFocused = wSwitchPanelSelectNext(swpanel, !next, True, False); else newFocused = wSwitchPanelSelectFirst(swpanel, False); @@ -164,7 +164,7 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool next, Bool class_onl && wKeyBindings[WKBD_GROUPNEXT].modifier == modifiers) || ev.xkey.keycode == rightKey) { - newFocused = wSwitchPanelSelectNext(swpanel, False, ev.xkey.keycode != rightKey); + newFocused = wSwitchPanelSelectNext(swpanel, False, ev.xkey.keycode != rightKey, (!class_only && wKeyBindings[WKBD_GROUPNEXT].keycode == ev.xkey.keycode && wKeyBindings[WKBD_GROUPNEXT].modifier == modifiers)); oldFocused = change_focus_and_raise(newFocused, oldFocused, swpanel, scr, False); } else if ((wKeyBindings[WKBD_FOCUSPREV].keycode == ev.xkey.keycode @@ -173,7 +173,7 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool next, Bool class_onl && wKeyBindings[WKBD_GROUPPREV].modifier == modifiers) || ev.xkey.keycode == leftKey) { - newFocused = wSwitchPanelSelectNext(swpanel, True, ev.xkey.keycode != leftKey); + newFocused = wSwitchPanelSelectNext(swpanel, True, ev.xkey.keycode != leftKey, (!class_only && wKeyBindings[WKBD_GROUPPREV].keycode == ev.xkey.keycode && wKeyBindings[WKBD_GROUPPREV].modifier == modifiers)); oldFocused = change_focus_and_raise(newFocused, oldFocused, swpanel, scr, False); } else if (ev.xkey.keycode == homeKey || ev.xkey.keycode == endKey) { diff --git a/src/switchpanel.c b/src/switchpanel.c index cd24f7b..cedc487 100644 --- a/src/switchpanel.c +++ b/src/switchpanel.c @@ -562,9 +562,9 @@ void wSwitchPanelDestroy(WSwitchPanel *panel) wfree(panel); } -WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back, int ignore_minimized) +WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back, int ignore_minimized, Bool class_only) { - WWindow *wwin; + WWindow *wwin, *curwin; int count = WMGetArrayItemCount(panel->windows); int orig = panel->current; @@ -580,14 +580,22 @@ WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back, int ignore_minimi if (ignore_minimized && canReceiveFocus(WMGetFromArray(panel->windows, (count + panel->current) % count)) < 0) ignore_minimized = False; + curwin = WMGetFromArray(panel->windows, orig); do { - if (back) - panel->current--; - else - panel->current++; + do { + if (back) + panel->current--; + else + panel->current++; + + panel->current= (count + panel->current) % count; + wwin = WMGetFromArray(panel->windows, panel->current); - panel->current= (count + panel->current) % count; - wwin = WMGetFromArray(panel->windows, panel->current); + if (!class_only) + break; + if (panel->current == orig) + break; + } while (!sameWindowClass(wwin, curwin)); } while (ignore_minimized && panel->current != orig && canReceiveFocus(wwin) < 0); if (panel->current < panel->firstVisible) diff --git a/src/switchpanel.h b/src/switchpanel.h index 041d222..2c4e642 100644 --- a/src/switchpanel.h +++ b/src/switchpanel.h @@ -27,7 +27,7 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, Bool class_only); void wSwitchPanelDestroy(WSwitchPanel *panel); -WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back, int ignore_minimized); +WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back, int ignore_minimized, Bool class_only); WWindow *wSwitchPanelSelectFirst(WSwitchPanel *panel, int back); WWindow *wSwitchPanelHandleEvent(WSwitchPanel *panel, XEvent *event); http://repo.or.cz/w/wmaker-crm.git/commit/8cb6a787264cc0adef2c82af0897ba8b8461783d commit 8cb6a787264cc0adef2c82af0897ba8b8461783d Author: Iain Patterson <w...@iain.cx> Date: Mon Apr 22 13:41:46 2013 +0100 Correct check for modifier in class-specific cycle. The hasModifier flag was set if the FocusNextKey or FocusPrevKey shortcuts had modifiers, depending on which shortcut was used to open the switchpanel. The switchpanel can also be opened with the GroupNextKey or GroupPrevKey shortcuts, so we should account for those when setting hasModifier. diff --git a/src/cycling.c b/src/cycling.c index a2168d6..f989554 100644 --- a/src/cycling.c +++ b/src/cycling.c @@ -105,10 +105,17 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool next, Bool class_onl if (!wwin) return; - if (next) - hasModifier = (wKeyBindings[WKBD_FOCUSNEXT].modifier != 0); - else - hasModifier = (wKeyBindings[WKBD_FOCUSPREV].modifier != 0); + if (next) { + if (class_only) + hasModifier = (wKeyBindings[WKBD_GROUPNEXT].modifier != 0); + else + hasModifier = (wKeyBindings[WKBD_FOCUSNEXT].modifier != 0); + } else { + if (class_only) + hasModifier = (wKeyBindings[WKBD_GROUPPREV].modifier != 0); + else + hasModifier = (wKeyBindings[WKBD_FOCUSPREV].modifier != 0); + } if (hasModifier) { keymap = XGetModifierMapping(dpy); http://repo.or.cz/w/wmaker-crm.git/commit/6fb2b13ec708b74d24377c96703793c1360d7659 commit 6fb2b13ec708b74d24377c96703793c1360d7659 Author: Iain Patterson <w...@iain.cx> Date: Mon Apr 22 13:46:22 2013 +0100 Added sameWindowClass(). Avoid code duplication by moving check for windows of the same WM_CLASS to the new function sameWindowClass(). diff --git a/src/switchpanel.c b/src/switchpanel.c index 4ad9b8c..cd24f7b 100644 --- a/src/switchpanel.c +++ b/src/switchpanel.c @@ -95,6 +95,16 @@ static int canReceiveFocus(WWindow *wwin) return 1; } +static Bool sameWindowClass(WWindow *wwin, WWindow *curwin) +{ + if (!wwin->wm_class || !curwin->wm_class) + return False; + if (strcmp(wwin->wm_class, curwin->wm_class)) + return False; + + return True; +} + static void changeImage(WSwitchPanel *panel, int idecks, int selected) { WMFrame *icon = WMGetFromArray(panel->icons, idecks); @@ -338,12 +348,9 @@ static WMArray *makeWindowListArray(WWindow *curwin, int include_unmapped, Bool for (wwin = curwin; wwin; wwin = wwin->prev) { if (((!fl && canReceiveFocus(wwin) > 0) || (fl && canReceiveFocus(wwin) < 0)) && (wwin->flags.mapped || include_unmapped)) { - if (class_only) { - if (!wwin->wm_class || !curwin->wm_class) + if (class_only) + if (!sameWindowClass(wwin, curwin)) continue; - if (strcmp(wwin->wm_class, curwin->wm_class)) - continue; - } if (!WFLAGP(wwin, skip_switchpanel)) WMAddToArray(windows, wwin); @@ -357,13 +364,9 @@ static WMArray *makeWindowListArray(WWindow *curwin, int include_unmapped, Bool for (wwin = curwin; wwin && wwin != curwin; wwin = wwin->prev) { if (((!fl && canReceiveFocus(wwin) > 0) || (fl && canReceiveFocus(wwin) < 0)) && (wwin->flags.mapped || include_unmapped)) { - if (class_only) { - if (!wwin->wm_class || !curwin->wm_class) - continue; - if (strcmp(wwin->wm_class, curwin->wm_class)) + if (class_only) + if (!sameWindowClass(wwin, curwin)) continue; - } - if (!WFLAGP(wwin, skip_switchpanel)) WMAddToArray(windows, wwin); } http://repo.or.cz/w/wmaker-crm.git/commit/90675a6f048fef9663e28f74022c2ca4f7da0c9e commit 90675a6f048fef9663e28f74022c2ca4f7da0c9e Author: Iain Patterson <w...@iain.cx> Date: Mon Apr 22 10:56:38 2013 +0100 Set StrictWindozeCycle by default. Window Maker's behaviour changes when StrictWindozeCycle is active. As a rule we try not to set the default value of new options such that they would change the behaviour expected by users. In this case, however, the switchpanel was not working as intended. Users who prefer the old method can set StrictWindozeCycle off with wdwrite WindowMaker StrictWindozeCycle NO diff --git a/src/defaults.c b/src/defaults.c index 748f839..a2d6e21 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -474,7 +474,7 @@ WDefaultEntry optionList[] = { &wPreferences.dont_blink, getBool, NULL, NULL, NULL}, {"SingleClickLaunch", "NO", NULL, &wPreferences.single_click, getBool, NULL, NULL, NULL}, - {"StrictWindozeCycle", "NO", NULL, + {"StrictWindozeCycle", "YES", NULL, &wPreferences.strict_windoze_cycle, getBool, NULL, NULL, NULL}, /* style options */ http://repo.or.cz/w/wmaker-crm.git/commit/c9937f6f6a060284f7430da2901e53be6a9d4c26 commit c9937f6f6a060284f7430da2901e53be6a9d4c26 Author: Iain Patterson <w...@iain.cx> Date: Mon Apr 22 10:49:45 2013 +0100 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. diff --git a/src/WindowMaker.h b/src/WindowMaker.h index 50d5dc2..bc034d9 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 b2c7726..a2168d6 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 53d8173..748f839 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 */ ----------------------------------------------------------------------- Summary of changes: src/WindowMaker.h | 1 + src/cycling.c | 25 ++++++++++++++++++------- src/defaults.c | 2 ++ src/switchpanel.c | 51 +++++++++++++++++++++++++++++++-------------------- src/switchpanel.h | 2 +- 5 files changed, 53 insertions(+), 28 deletions(-) repo.or.cz automatic notification. Contact project admin crma...@gmail.com if you want to unsubscribe, or site admin ad...@repo.or.cz if you receive no reply. -- wmaker-crm.git ("The Window Maker window manager") -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.