summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-20 08:49:51 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-10-20 08:57:09 +1000
commit9b828939e5147300bef99820180b7c8de3ba260d (patch)
tree8b4b106bf2eeeb7bc58c8e7aa3165f8ce66bdfac
parentMerge pull request #2883 from ponkyh/missing-stdlib (diff)
downloadsway-9b828939e5147300bef99820180b7c8de3ba260d.tar.gz
sway-9b828939e5147300bef99820180b7c8de3ba260d.tar.zst
sway-9b828939e5147300bef99820180b7c8de3ba260d.zip
Fix crash when ending tiling drag
If the container being dragged has a parent that needs to be reaped, it must be reaped after we've reinserted the dragging container into the tree. During reaping, handle_seat_node_destroy tries to refocus the dragging container which isn't possible while it's detached.
-rw-r--r--sway/input/seat.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sway/input/seat.c b/sway/input/seat.c
index cffceaae..659ec89b 100644
--- a/sway/input/seat.c
+++ b/sway/input/seat.c
@@ -1110,9 +1110,6 @@ static void seat_end_move_tiling(struct sway_seat *seat) {
1110 int after = edge != WLR_EDGE_TOP && edge != WLR_EDGE_LEFT; 1110 int after = edge != WLR_EDGE_TOP && edge != WLR_EDGE_LEFT;
1111 1111
1112 container_detach(con); 1112 container_detach(con);
1113 if (old_parent) {
1114 container_reap_empty(old_parent);
1115 }
1116 1113
1117 // Moving container into empty workspace 1114 // Moving container into empty workspace
1118 if (target_node->type == N_WORKSPACE && edge == WLR_EDGE_NONE) { 1115 if (target_node->type == N_WORKSPACE && edge == WLR_EDGE_NONE) {
@@ -1135,6 +1132,10 @@ static void seat_end_move_tiling(struct sway_seat *seat) {
1135 workspace_insert_tiling(new_ws, con, after); 1132 workspace_insert_tiling(new_ws, con, after);
1136 } 1133 }
1137 1134
1135 if (old_parent) {
1136 container_reap_empty(old_parent);
1137 }
1138
1138 // This is a bit dirty, but we'll set the dimensions to that of a sibling. 1139 // This is a bit dirty, but we'll set the dimensions to that of a sibling.
1139 // I don't think there's any other way to make it consistent without 1140 // I don't think there's any other way to make it consistent without
1140 // changing how we auto-size containers. 1141 // changing how we auto-size containers.