aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2019-06-16 17:36:00 +0200
committerFurkan Sahin <furkan-dev@proton.me>2019-06-16 17:36:00 +0200
commit93174b96c01e6529045264bb5da46391aa8a3507 (patch)
tree02a17ffe6af7d5939129f02291036cb1633dddf9 /include
parent81c66bac34fc5b653a0187a27b5696c8477bcc76 (diff)
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 'include')
-rw-r--r--include/sway/tree/root.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/sway/tree/root.h b/include/sway/tree/root.h
index c4f84207..799d751a 100644
--- a/include/sway/tree/root.h
+++ b/include/sway/tree/root.h
@@ -46,8 +46,12 @@ void root_destroy(struct sway_root *root);
/**
* Move a container to the scratchpad.
+ * If a workspace is passed, the container is assumed to have been in
+ * the scratchpad before and is shown on the workspace.
+ * The ws parameter can safely be NULL.
*/
-void root_scratchpad_add_container(struct sway_container *con);
+void root_scratchpad_add_container(struct sway_container *con,
+ struct sway_workspace *ws);
/**
* Remove a container from the scratchpad.