aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Ashworth <bosrsf04@gmail.com>2019-02-22 00:10:02 -0500
committeremersion <contact@emersion.fr>2019-02-22 08:13:51 +0100
commit7252ca09a7ccd09673a2903509cde6dcb077bfb7 (patch)
tree628437653034db8c066311a416534edae45da080
parent16ddd00102c7713b7d1c404393768eb06c829751 (diff)
downloadsway-7252ca09a7ccd09673a2903509cde6dcb077bfb7.zip
sway-7252ca09a7ccd09673a2903509cde6dcb077bfb7.tar.gz
sway-7252ca09a7ccd09673a2903509cde6dcb077bfb7.tar.bz2
move scratchpad: hide visible scratchpad container
This makes it so running `move [to] scratchpad` on a container already in the scratchpad does not return an error. To match i3's behavior, a visible scratchpad container will be hidden and a hidden scratchpad container will be treated as a noop.
-rw-r--r--sway/commands/move.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c
index b593138..4306aac 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -854,11 +854,11 @@ static struct cmd_results *cmd_move_to_scratchpad(void) {
}
}
- if (con->scratchpad) {
- return cmd_results_new(CMD_INVALID,
- "Container is already in the scratchpad");
+ if (!con->scratchpad) {
+ root_scratchpad_add_container(con);
+ } else if (con->workspace) {
+ root_scratchpad_hide(con);
}
- root_scratchpad_add_container(con);
return cmd_results_new(CMD_SUCCESS, NULL);
}