]> git.mdlowis.com Git - proto/labwc.git/commitdiff
workspaces: allow referencing the current workspace
authorConsus <consus@ftml.net>
Tue, 29 Aug 2023 10:12:09 +0000 (13:12 +0300)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sun, 1 Oct 2023 13:17:29 +0000 (14:17 +0100)
This value allows a user to reference the currently visible workspace.

docs/labwc-actions.5.scd
src/workspaces.c

index d21a79b8c475a20a6fe0ded00d53ec7dcee36ae2..b5fc6ef46f3d4d6f2856dd347be219093b3b307e 100644 (file)
@@ -127,9 +127,9 @@ Actions are used in menus and keyboard/mouse bindings.
 *<action name="GoToDesktop" to="value" wrap="yes" />*
        Switch to workspace.
 
-       *to* The workspace to switch to. Supported values are "last", "left",
-       "right" or the full name of a workspace or its index (starting at 1)
-       as configured in rc.xml.
+       *to* The workspace to switch to. Supported values are "current", "last",
+       "left", "right" or the full name of a workspace or its index (starting
+       at 1) as configured in rc.xml.
 
        *wrap* [yes|no] Wrap around from last desktop to first, and vice
        versa. Default yes.
index bd9bdab04cb73d3880acbabb9f53861022e47920..89bf030b3e2b8c049bef7654445ca8ace0fd0528 100644 (file)
@@ -340,6 +340,8 @@ workspaces_find(struct workspace *anchor, const char *name, bool wrap)
                                return target;
                        }
                }
+       } else if (!strcasecmp(name, "current")) {
+               return anchor;
        } else if (!strcasecmp(name, "last")) {
                return anchor->server->workspace_last;
        } else if (!strcasecmp(name, "left")) {