diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2018-06-26 21:19:38 +0900 |
---|---|---|
committer | Dominique Martinet <asmadeus@codewreck.org> | 2018-06-26 21:20:56 +0900 |
commit | 6856866a612c9f0708a42cbe6d9627173d9e3569 (patch) | |
tree | 14be83d7e63450352c85e9723977c5f1001ae3c7 /sway/desktop/layer_shell.c | |
parent | layer_shell: cleanup output link on output destroy (diff) | |
download | sway-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/layer_shell.c')
-rw-r--r-- | sway/desktop/layer_shell.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index 94dc22e7..b57d1ee6 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c | |||
@@ -352,10 +352,6 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { | |||
352 | wl_signal_add(&layer_surface->surface->events.commit, | 352 | wl_signal_add(&layer_surface->surface->events.commit, |
353 | &sway_layer->surface_commit); | 353 | &sway_layer->surface_commit); |
354 | 354 | ||
355 | sway_layer->output_destroy.notify = handle_output_destroy; | ||
356 | wl_signal_add(&layer_surface->output->events.destroy, | ||
357 | &sway_layer->output_destroy); | ||
358 | |||
359 | sway_layer->destroy.notify = handle_destroy; | 355 | sway_layer->destroy.notify = handle_destroy; |
360 | wl_signal_add(&layer_surface->events.destroy, &sway_layer->destroy); | 356 | wl_signal_add(&layer_surface->events.destroy, &sway_layer->destroy); |
361 | sway_layer->map.notify = handle_map; | 357 | sway_layer->map.notify = handle_map; |
@@ -368,6 +364,9 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { | |||
368 | layer_surface->data = sway_layer; | 364 | layer_surface->data = sway_layer; |
369 | 365 | ||
370 | struct sway_output *output = layer_surface->output->data; | 366 | struct sway_output *output = layer_surface->output->data; |
367 | sway_layer->output_destroy.notify = handle_output_destroy; | ||
368 | wl_signal_add(&output->events.destroy, &sway_layer->output_destroy); | ||
369 | |||
371 | wl_list_insert(&output->layers[layer_surface->layer], &sway_layer->link); | 370 | wl_list_insert(&output->layers[layer_surface->layer], &sway_layer->link); |
372 | 371 | ||
373 | // Temporarily set the layer's current state to client_pending | 372 | // Temporarily set the layer's current state to client_pending |