]> git.mdlowis.com Git - proto/labwc.git/commitdiff
windowswitcher: show 's' as "state" for shaded views
authorTomi Ollila <tomi.ollila@iki.fi>
Sun, 6 Jul 2025 21:53:36 +0000 (00:53 +0300)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Mon, 13 Oct 2025 20:57:23 +0000 (22:57 +0200)
While at it sorted the code to show 'm' before 's' and 's' before 'M'
- from the least visible to the most visible state.

docs/labwc-config.5.scd
src/osd/osd-field.c

index 995be07cb92683e03f8cfca9109eae7d675f3f24..ca167b62cabfe8bfcec53ce22f02915a7e6cb8e0 100644 (file)
@@ -401,9 +401,9 @@ this is for compatibility with Openbox.
          fields are:
                - 'B' - shell type, values [xwayland|xdg-shell]
                - 'b' - shell type (short form), values [X|W]
-               - 'S' - state of window, values [M|m|F] (3 spaces allocated)
-                       (maximized, minimized, fullscreen)
-               - 's' - state of window (short form), values [M|m|F] (1 space)
+               - 'S' - state of window, values [m|s|M|F] (4 spaces allocated)
+                       (minimized, shaded, maximized, fullscreen)
+               - 's' - state of window (short form), values [m|s|M|F] (1 space)
                - 'I' - wm-class/app-id
                - 'i' - wm-class/app-id trimmed, remove "org." if available
                - 'n' - desktop entry/file application name, falls back to
index 9852b11fc65f7c26f9252c1adad78cc1e4c262c1..01c4e48bcbb2288f0ef25da40dfa1cf5d26797be 100644 (file)
@@ -111,10 +111,12 @@ static void
 field_set_win_state(struct buf *buf, struct view *view, const char *format)
 {
        /* custom type conversion-specifier: s */
-       if (view->maximized) {
-               buf_add(buf, "M");
-       } else if (view->minimized) {
+       if (view->minimized) {
                buf_add(buf, "m");
+       } else if (view->shaded) {
+               buf_add(buf, "s");
+       } else if (view->maximized) {
+               buf_add(buf, "M");
        } else if (view->fullscreen) {
                buf_add(buf, "F");
        } else {
@@ -127,6 +129,7 @@ field_set_win_state_all(struct buf *buf, struct view *view, const char *format)
 {
        /* custom type conversion-specifier: S */
        buf_add(buf, view->minimized ? "m" : " ");
+       buf_add(buf, view->shaded ? "s" : " ");
        buf_add(buf, view->maximized ? "M" : " ");
        buf_add(buf, view->fullscreen ? "F" : " ");
        /* TODO: add always-on-top and omnipresent ? */