aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/move.c
diff options
context:
space:
mode:
authorLibravatar Rouven Czerwinski <rouven@czerwinskis.de>2019-06-16 17:36:00 +0200
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-06-16 12:29:16 -0400
commitddad41f423db14f89f765fc134d45d1ea8a60caf (patch)
tree02a17ffe6af7d5939129f02291036cb1633dddf9 /sway/commands/move.c
parentAdd missing underscore in bindswitch documentation (diff)
downloadsway-ddad41f423db14f89f765fc134d45d1ea8a60caf.tar.gz
sway-ddad41f423db14f89f765fc134d45d1ea8a60caf.tar.zst
sway-ddad41f423db14f89f765fc134d45d1ea8a60caf.zip
Fix sway crashes for scratchpad layouts
Currently container_replace removes the container from the scratchpad and re-adds it afterwards. For the split commands this results in the container being send to the scratchpad, which results in a NULL segfault if the same container should be shown. Pass an optional workspace to root_scratchpad_add_container, if the workspace is passed the window will continue to show on the workspace. If NULL is passed it is sent to the scratchpad. This was an issue if no other window except the scratchpad container was on the workspace. Fixes #4240
Diffstat (limited to 'sway/commands/move.c')
-rw-r--r--sway/commands/move.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/commands/move.c b/sway/commands/move.c
index 9c6e69ec..6fd66f28 100644
--- a/sway/commands/move.c
+++ b/sway/commands/move.c
@@ -856,7 +856,7 @@ static struct cmd_results *cmd_move_to_scratchpad(void) {
856 } 856 }
857 857
858 if (!con->scratchpad) { 858 if (!con->scratchpad) {
859 root_scratchpad_add_container(con); 859 root_scratchpad_add_container(con, NULL);
860 } else if (con->workspace) { 860 } else if (con->workspace) {
861 root_scratchpad_hide(con); 861 root_scratchpad_hide(con);
862 } 862 }