From 1b9e63b1e83eb3402a77e9109c7afbc9e8661e21 Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Sun, 29 Jan 2023 07:25:04 +0100 Subject: [PATCH] ToggleShowDesktop: add action --- docs/labwc-actions.5.scd | 3 +++ src/action.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/labwc-actions.5.scd b/docs/labwc-actions.5.scd index 10c3b542..d246074a 100644 --- a/docs/labwc-actions.5.scd +++ b/docs/labwc-actions.5.scd @@ -83,6 +83,9 @@ Actions are used in menus and keyboard/mouse bindings. Send active window to workspace. Supported values are the same as for GoToDesktop. +** + Hide / unhide all windows + ** If used as the only action for a binding: clear an earlier defined binding. diff --git a/src/action.c b/src/action.c index 09992ef1..2b308e57 100644 --- a/src/action.c +++ b/src/action.c @@ -59,7 +59,8 @@ enum action_type { ACTION_TYPE_RESIZE, ACTION_TYPE_GO_TO_DESKTOP, ACTION_TYPE_SEND_TO_DESKTOP, - ACTION_TYPE_SNAP_TO_REGION + ACTION_TYPE_SNAP_TO_REGION, + ACTION_TYPE_TOGGLE_SHOW_DESKTOP, }; const char *action_names[] = { @@ -88,6 +89,7 @@ const char *action_names[] = { "GoToDesktop", "SendToDesktop", "SnapToRegion", + "ToggleShowDesktop", NULL }; @@ -445,6 +447,8 @@ actions_run(struct view *activator, struct server *server, wlr_log(WLR_ERROR, "Invalid SnapToRegion id: '%s'", region_name); } break; + case ACTION_TYPE_TOGGLE_SHOW_DESKTOP: + desktop_toggle(server); case ACTION_TYPE_NONE: break; case ACTION_TYPE_INVALID: