aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/layer_shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/layer_shell.c')
-rw-r--r--sway/desktop/layer_shell.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index a2506d21..bd62f84a 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -192,9 +192,10 @@ void arrange_layers(struct sway_output *output) {
static void handle_output_destroy(struct wl_listener *listener, void *data) {
struct sway_layer_surface *sway_layer =
wl_container_of(listener, sway_layer, output_destroy);
- sway_layer->layer_surface->output = NULL;
wl_list_remove(&sway_layer->output_destroy.link);
wl_list_remove(&sway_layer->output_mode.link);
+ wl_list_remove(&sway_layer->output_transform.link);
+ sway_layer->layer_surface->output = NULL;
wlr_layer_surface_close(sway_layer->layer_surface);
}
@@ -240,9 +241,11 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_list_remove(&sway_layer->map.link);
wl_list_remove(&sway_layer->unmap.link);
wl_list_remove(&sway_layer->surface_commit.link);
- wl_list_remove(&sway_layer->output_destroy.link);
- wl_list_remove(&sway_layer->output_mode.link);
- wl_list_remove(&sway_layer->output_transform.link);
+ if (sway_layer->layer_surface->output != NULL) {
+ wl_list_remove(&sway_layer->output_destroy.link);
+ wl_list_remove(&sway_layer->output_mode.link);
+ wl_list_remove(&sway_layer->output_transform.link);
+ }
struct sway_output *output = sway_layer->layer_surface->output->data;
arrange_layers(output);
free(sway_layer);