aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-05 17:59:31 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-09-05 18:01:43 +1000
commitdbf4aa3e33bdee53876c6893b15ac3f224818e7c (patch)
treeba4ded7f1c63a9ec620122482cadcf0ad68661fa /sway/tree/container.c
parentFix inversed condition in criteria (diff)
downloadsway-dbf4aa3e33bdee53876c6893b15ac3f224818e7c.tar.gz
sway-dbf4aa3e33bdee53876c6893b15ac3f224818e7c.tar.zst
sway-dbf4aa3e33bdee53876c6893b15ac3f224818e7c.zip
Allow marked containers to be moved out of the scratchpad via move command
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index fbce8158..c91b0361 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -1116,9 +1116,11 @@ void container_detach(struct sway_container *child) {
1116 struct sway_container *old_parent = child->parent; 1116 struct sway_container *old_parent = child->parent;
1117 struct sway_workspace *old_workspace = child->workspace; 1117 struct sway_workspace *old_workspace = child->workspace;
1118 list_t *siblings = container_get_siblings(child); 1118 list_t *siblings = container_get_siblings(child);
1119 int index = list_find(siblings, child); 1119 if (siblings) {
1120 if (index != -1) { 1120 int index = list_find(siblings, child);
1121 list_del(siblings, index); 1121 if (index != -1) {
1122 list_del(siblings, index);
1123 }
1122 } 1124 }
1123 child->parent = NULL; 1125 child->parent = NULL;
1124 child->workspace = NULL; 1126 child->workspace = NULL;
@@ -1127,7 +1129,7 @@ void container_detach(struct sway_container *child) {
1127 if (old_parent) { 1129 if (old_parent) {
1128 container_update_representation(old_parent); 1130 container_update_representation(old_parent);
1129 node_set_dirty(&old_parent->node); 1131 node_set_dirty(&old_parent->node);
1130 } else { 1132 } else if (old_workspace) {
1131 workspace_update_representation(old_workspace); 1133 workspace_update_representation(old_workspace);
1132 node_set_dirty(&old_workspace->node); 1134 node_set_dirty(&old_workspace->node);
1133 } 1135 }