cycle: update config to <osd output="all|cursor|focused">

I think `<windowSwitcher><osd output="keyboard">` is a bit unclear and
hard to interpret as "show OSD in the output with keyboard focus". Also,
we use "cursor" instead of "pointer" in other configurations like
`<placement policy="cursor">` and `<action name="ShowMenu" atCursor="">`.

So let's replace `output="all|pointer|keyboard"` with
`output="all|cursor|focused"`. In documentation, I reordered them to
`output="all|focused|cursor"` as "focused" feels like a bit more
sophisticated and general policy.
This commit is contained in:
tokyo4j 2025-12-03 00:41:04 +09:00 committed by Consolatis
parent 71d29cbebb
commit c4277ab507
4 changed files with 12 additions and 12 deletions

View file

@ -1222,13 +1222,13 @@ entry(xmlNode *node, char *nodename, char *content)
} else if (!strcasecmp(nodename, "output.osd.windowSwitcher")) {
if (!strcasecmp(content, "all")) {
rc.window_switcher.output_criteria = CYCLE_OSD_OUTPUT_ALL;
} else if (!strcasecmp(content, "pointer")) {
rc.window_switcher.output_criteria = CYCLE_OSD_OUTPUT_POINTER;
} else if (!strcasecmp(content, "keyboard")) {
rc.window_switcher.output_criteria = CYCLE_OSD_OUTPUT_KEYBOARD;
} else if (!strcasecmp(content, "cursor")) {
rc.window_switcher.output_criteria = CYCLE_OSD_OUTPUT_CURSOR;
} else if (!strcasecmp(content, "focused")) {
rc.window_switcher.output_criteria = CYCLE_OSD_OUTPUT_FOCUSED;
} else {
wlr_log(WLR_ERROR, "Invalid windowSwitcher output %s: "
"should be one of all|pointer|keyboard", content);
"should be one of all|focused|cursor", content);
}
/* The following two are for backward compatibility only. */

View file

@ -299,10 +299,10 @@ init_cycle(struct server *server)
}
break;
}
case CYCLE_OSD_OUTPUT_POINTER:
case CYCLE_OSD_OUTPUT_CURSOR:
create_osd_on_output(output_nearest_to_cursor(server));
break;
case CYCLE_OSD_OUTPUT_KEYBOARD: {
case CYCLE_OSD_OUTPUT_FOCUSED: {
struct output *output;
if (server->active_view) {
output = server->active_view->output;