aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar Dominique Martinet <asmadeus@codewreck.org>2018-06-26 21:19:38 +0900
committerLibravatar Dominique Martinet <asmadeus@codewreck.org>2018-06-26 21:20:56 +0900
commit6856866a612c9f0708a42cbe6d9627173d9e3569 (patch)
tree14be83d7e63450352c85e9723977c5f1001ae3c7 /sway/desktop/output.c
parentlayer_shell: cleanup output link on output destroy (diff)
downloadsway-6856866a612c9f0708a42cbe6d9627173d9e3569.tar.gz
sway-6856866a612c9f0708a42cbe6d9627173d9e3569.tar.zst
sway-6856866a612c9f0708a42cbe6d9627173d9e3569.zip
layer_shell: order destroying before sway_output
Both sway_output and sway_layer_shell listen to wlr's output destroy event, but sway_layer_shell needs to access into sway_output's data strucure and needs to be destroyed first. Resolve this by making sway_layer_shell listen to a new event that happens at start of sway_output's destroy handler
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index d4115be8..f0f1603a 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -1199,6 +1199,8 @@ static void damage_handle_destroy(struct wl_listener *listener, void *data) {
1199 1199
1200static void handle_destroy(struct wl_listener *listener, void *data) { 1200static void handle_destroy(struct wl_listener *listener, void *data) {
1201 struct sway_output *output = wl_container_of(listener, output, destroy); 1201 struct sway_output *output = wl_container_of(listener, output, destroy);
1202 wl_signal_emit(&output->events.destroy, output);
1203
1202 if (output->swayc) { 1204 if (output->swayc) {
1203 container_destroy(output->swayc); 1205 container_destroy(output->swayc);
1204 } 1206 }
@@ -1277,6 +1279,7 @@ void output_enable(struct sway_output *output) {
1277 for (size_t i = 0; i < len; ++i) { 1279 for (size_t i = 0; i < len; ++i) {
1278 wl_list_init(&output->layers[i]); 1280 wl_list_init(&output->layers[i]);
1279 } 1281 }
1282 wl_signal_init(&output->events.destroy);
1280 1283
1281 input_manager_configure_xcursor(input_manager); 1284 input_manager_configure_xcursor(input_manager);
1282 1285