diff options
Diffstat (limited to 'sway/desktop/layer_shell.c')
-rw-r--r-- | sway/desktop/layer_shell.c | 11 |
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) { | |||
192 | static void handle_output_destroy(struct wl_listener *listener, void *data) { | 192 | static void handle_output_destroy(struct wl_listener *listener, void *data) { |
193 | struct sway_layer_surface *sway_layer = | 193 | struct sway_layer_surface *sway_layer = |
194 | wl_container_of(listener, sway_layer, output_destroy); | 194 | wl_container_of(listener, sway_layer, output_destroy); |
195 | sway_layer->layer_surface->output = NULL; | ||
196 | wl_list_remove(&sway_layer->output_destroy.link); | 195 | wl_list_remove(&sway_layer->output_destroy.link); |
197 | wl_list_remove(&sway_layer->output_mode.link); | 196 | wl_list_remove(&sway_layer->output_mode.link); |
197 | wl_list_remove(&sway_layer->output_transform.link); | ||
198 | sway_layer->layer_surface->output = NULL; | ||
198 | wlr_layer_surface_close(sway_layer->layer_surface); | 199 | wlr_layer_surface_close(sway_layer->layer_surface); |
199 | } | 200 | } |
200 | 201 | ||
@@ -240,9 +241,11 @@ static void handle_destroy(struct wl_listener *listener, void *data) { | |||
240 | wl_list_remove(&sway_layer->map.link); | 241 | wl_list_remove(&sway_layer->map.link); |
241 | wl_list_remove(&sway_layer->unmap.link); | 242 | wl_list_remove(&sway_layer->unmap.link); |
242 | wl_list_remove(&sway_layer->surface_commit.link); | 243 | wl_list_remove(&sway_layer->surface_commit.link); |
243 | wl_list_remove(&sway_layer->output_destroy.link); | 244 | if (sway_layer->layer_surface->output != NULL) { |
244 | wl_list_remove(&sway_layer->output_mode.link); | 245 | wl_list_remove(&sway_layer->output_destroy.link); |
245 | wl_list_remove(&sway_layer->output_transform.link); | 246 | wl_list_remove(&sway_layer->output_mode.link); |
247 | wl_list_remove(&sway_layer->output_transform.link); | ||
248 | } | ||
246 | struct sway_output *output = sway_layer->layer_surface->output->data; | 249 | struct sway_output *output = sway_layer->layer_surface->output->data; |
247 | arrange_layers(output); | 250 | arrange_layers(output); |
248 | free(sway_layer); | 251 | free(sway_layer); |