aboutsummaryrefslogtreecommitdiffstats
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.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index 03419ac1..c904880d 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -255,6 +255,9 @@ static void unmap(struct sway_layer_surface *sway_layer) {
255 return; 255 return;
256 } 256 }
257 struct sway_output *output = wlr_output->data; 257 struct sway_output *output = wlr_output->data;
258 if (output == NULL) {
259 return;
260 }
258 output_damage_surface(output, sway_layer->geo.x, sway_layer->geo.y, 261 output_damage_surface(output, sway_layer->geo.x, sway_layer->geo.y,
259 sway_layer->layer_surface->surface, true); 262 sway_layer->layer_surface->surface, true);
260} 263}
@@ -274,9 +277,11 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
274 wl_list_remove(&sway_layer->surface_commit.link); 277 wl_list_remove(&sway_layer->surface_commit.link);
275 if (sway_layer->layer_surface->output != NULL) { 278 if (sway_layer->layer_surface->output != NULL) {
276 struct sway_output *output = sway_layer->layer_surface->output->data; 279 struct sway_output *output = sway_layer->layer_surface->output->data;
277 arrange_layers(output); 280 if (output != NULL) {
278 281 arrange_layers(output);
282 }
279 wl_list_remove(&sway_layer->output_destroy.link); 283 wl_list_remove(&sway_layer->output_destroy.link);
284 sway_layer->layer_surface->output = NULL;
280 } 285 }
281 free(sway_layer); 286 free(sway_layer);
282} 287}