window-switcher: add order parameter to allow stable window list ordering
Some checks failed
labwc.github.io / notify (push) Has been cancelled

Add a new configuration option to control the window switcher traversal order.

`order="focus"` cycling is convenient for quick toggling, but some users - me as well -
prefer a stable taskbar-like order which can now be achieved with `order="age"`.
This commit is contained in:
Maik Broemme 2025-12-08 18:54:23 +01:00 committed by GitHub
parent eecb5d0947
commit 8fdf375af3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 45 additions and 2 deletions

View file

@ -1240,6 +1240,15 @@ entry(xmlNode *node, char *nodename, char *content)
wlr_log(WLR_ERROR, "Invalid windowSwitcher output %s: "
"should be one of all|focused|cursor", content);
}
} else if (!strcasecmp(nodename, "order.windowSwitcher")) {
if (!strcasecmp(content, "focus")) {
rc.window_switcher.order = WINDOW_SWITCHER_ORDER_FOCUS;
} else if (!strcasecmp(content, "age")) {
rc.window_switcher.order = WINDOW_SWITCHER_ORDER_AGE;
} else {
wlr_log(WLR_ERROR, "Invalid windowSwitcher order %s: "
"should be one of focus|age", content);
}
/* The following two are for backward compatibility only. */
} else if (!strcasecmp(nodename, "show.windowSwitcher")) {
@ -1485,6 +1494,7 @@ rcxml_init(void)
rc.window_switcher.criteria = LAB_VIEW_CRITERIA_CURRENT_WORKSPACE
| LAB_VIEW_CRITERIA_ROOT_TOPLEVEL
| LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER;
rc.window_switcher.order = WINDOW_SWITCHER_ORDER_FOCUS;
rc.resize_indicator = LAB_RESIZE_INDICATOR_NEVER;
rc.resize_draw_contents = true;