]> git.mdlowis.com Git - proto/labwc.git/commitdiff
cycle: update config to <osd output="all|cursor|focused">
authortokyo4j <hrak1529@gmail.com>
Tue, 2 Dec 2025 15:41:04 +0000 (00:41 +0900)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Tue, 2 Dec 2025 16:09:54 +0000 (17:09 +0100)
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.

docs/labwc-config.5.scd
include/config/types.h
src/config/rcxml.c
src/cycle/cycle.c

index d772edb3a8c0e3b0afe74a2d90c49a0d119addd2..fa4f7e583cf4f4acfd0074ee2d090bb7451b0e4a 100644 (file)
@@ -371,10 +371,10 @@ this is for compatibility with Openbox.
        "classic" displays window information like icons and titles in a vertical list.
        "thumbnail" shows window thumbnail, icon and title in grids.
 
-       *output* [all|pointer|keyboard] Configures which monitor(s) show the OSD.
+       *output* [all|focused|cursor] Configures which monitor(s) show the OSD.
        "all" displays the OSD on all monitors.
-       "pointer" displays the OSD on the monitor containing the mouse pointer.
-       "keyboard" displays the OSD on the monitor with keyboard focus.
+       "focused" displays the OSD on the monitor with keyboard focus.
+       "cursor" displays the OSD on the monitor containing the mouse pointer.
        Default is "all".
 
        *thumbnailLabelFormat* Format to be used for the thumbnail label according to *custom*
index 7cb9feab3846d225465d024647a85c17eae20ba9..757796a6d6e67dc45dbd0bc0f2f699ccd24bb6bd 100644 (file)
@@ -114,8 +114,8 @@ enum cycle_osd_style {
 
 enum cycle_osd_output_criteria {
        CYCLE_OSD_OUTPUT_ALL,
-       CYCLE_OSD_OUTPUT_POINTER,
-       CYCLE_OSD_OUTPUT_KEYBOARD,
+       CYCLE_OSD_OUTPUT_CURSOR,
+       CYCLE_OSD_OUTPUT_FOCUSED,
 };
 
 #endif /* LABWC_CONFIG_TYPES_H */
index ed51e20de11f15146fbbce88d2465739f96d0d22..c5d94d4f35affd0f2d4ebe61c8e4f7fea760ded1 100644 (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. */
index 292e64365456ba33ab99ac9bbd479bd26273e817..8eabaf6cd4a7bca8b952d4d871db47f10c22d2fb 100644 (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;