aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-02-22 00:10:02 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-02-25 17:10:04 -0500
commit8aaba944a81d85d9f8a0ae29f4314e303c420853 (patch)
tree3d615113a6f8def96496bcd271082bfbf109ff9f
parentcommands/move: reintroduce wrongly removed NULL check (diff)
downloadsway-8aaba944a81d85d9f8a0ae29f4314e303c420853.tar.gz
sway-8aaba944a81d85d9f8a0ae29f4314e303c420853.tar.zst
sway-8aaba944a81d85d9f8a0ae29f4314e303c420853.zip
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 b593138a..4306aac8 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -854,11 +854,11 @@ static struct cmd_results *cmd_move_to_scratchpad(void) {
854 } 854 }
855 } 855 }
856 856
857 if (con->scratchpad) { 857 if (!con->scratchpad) {
858 return cmd_results_new(CMD_INVALID, 858 root_scratchpad_add_container(con);
859 "Container is already in the scratchpad"); 859 } else if (con->workspace) {
860 root_scratchpad_hide(con);
860 } 861 }
861 root_scratchpad_add_container(con);
862 return cmd_results_new(CMD_SUCCESS, NULL); 862 return cmd_results_new(CMD_SUCCESS, NULL);
863} 863}
864 864