aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-06-26 20:14:58 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-06-26 20:14:58 +1000
commit93696b78ecbc31ec34be97ec26836efb74d359f0 (patch)
tree4e39f49907af118e3b288c5e38464eb525e1e18b
parentFix crash when disconnecting output (diff)
downloadsway-93696b78ecbc31ec34be97ec26836efb74d359f0.tar.gz
sway-93696b78ecbc31ec34be97ec26836efb74d359f0.tar.zst
sway-93696b78ecbc31ec34be97ec26836efb74d359f0.zip
Fix crash when closing output window from outer session
Emitting the close event needs to happen before container_output_destroy, because container_output_destroy sets the sway_output to NULL and sway_output is used in IPC.
-rw-r--r--sway/tree/container.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 2f041a36..0c860405 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -304,6 +304,9 @@ struct sway_container *container_destroy_noreaping(struct sway_container *con) {
304 return NULL; 304 return NULL;
305 } 305 }
306 306
307 wl_signal_emit(&con->events.destroy, con);
308 ipc_event_window(con, "close");
309
307 // The below functions move their children to somewhere else. 310 // The below functions move their children to somewhere else.
308 if (con->type == C_OUTPUT) { 311 if (con->type == C_OUTPUT) {
309 container_output_destroy(con); 312 container_output_destroy(con);
@@ -325,9 +328,6 @@ struct sway_container *container_destroy_noreaping(struct sway_container *con) {
325 } 328 }
326 } 329 }
327 330
328 wl_signal_emit(&con->events.destroy, con);
329 ipc_event_window(con, "close");
330
331 con->destroying = true; 331 con->destroying = true;
332 list_add(server.destroying_containers, con); 332 list_add(server.destroying_containers, con);
333 333