aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
authordb <github@benedik.si>2018-05-01 17:38:55 +0200
committerdb <github@benedik.si>2018-05-01 19:05:32 +0200
commit22170bde77a92126ab5c183604634bbb2b89a10a (patch)
tree926b0553f47eb786dc0c40ab99d2d56ebc64c66b /sway/desktop
parent0e51c7be449dd68025d5acd8c634f8dcacb10a16 (diff)
downloadsway-22170bde77a92126ab5c183604634bbb2b89a10a.tar.xz
Fix layer surface crash on output destroy
Before freeing sway_output, NULL the wlr_output reference to it. Check for that NULL in layer_shell handle_destroy. Don't damage null container in unmap. Additionaly, terminate swaybg if its output is being disabled.
Diffstat (limited to 'sway/desktop')
-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) {
return;
}
struct sway_output *output = wlr_output->data;
+ if (output == NULL) {
+ return;
+ }
output_damage_surface(output, sway_layer->geo.x, sway_layer->geo.y,
sway_layer->layer_surface->surface, true);
}
@@ -274,9 +277,11 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_list_remove(&sway_layer->surface_commit.link);
if (sway_layer->layer_surface->output != NULL) {
struct sway_output *output = sway_layer->layer_surface->output->data;
- arrange_layers(output);
-
+ if (output != NULL) {
+ arrange_layers(output);
+ }
wl_list_remove(&sway_layer->output_destroy.link);
+ sway_layer->layer_surface->output = NULL;
}
free(sway_layer);
}