aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Daniel De Graaf <code@danieldg.net>2024-01-21 09:08:52 -0500
committerLibravatar Kirill Primak <vyivel@eclair.cafe>2024-01-21 17:32:00 +0300
commit2c2625acd3a89ef2c4caa4094a3a51001041a524 (patch)
tree854a05f2dfcc231f5ab97f6720afdf34000802ba
parentAdd debug flag to re-enable wl_drm (diff)
downloadsway-2c2625acd3a89ef2c4caa4094a3a51001041a524.tar.gz
sway-2c2625acd3a89ef2c4caa4094a3a51001041a524.tar.zst
sway-2c2625acd3a89ef2c4caa4094a3a51001041a524.zip
Fix SIGSEGV on output destroy
``` Program terminated with signal SIGSEGV, Segmentation fault. 144 struct wlr_layer_surface_v1 *layer_surface = surface->layer_surface; [Current thread is 1 (Thread 0x7f1f7c5b3ac0 (LWP 2473))] (gdb) bt ``` Add a NULL check in `find_mapped_layer_by_client` like the one in `arrange_surface`.
-rw-r--r--sway/desktop/layer_shell.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index aca99c97..968b0cdb 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -140,6 +140,9 @@ static struct sway_layer_surface *find_mapped_layer_by_client(
140 wl_list_for_each (node, &output->layers.shell_overlay->children, link) { 140 wl_list_for_each (node, &output->layers.shell_overlay->children, link) {
141 struct sway_layer_surface *surface = scene_descriptor_try_get(node, 141 struct sway_layer_surface *surface = scene_descriptor_try_get(node,
142 SWAY_SCENE_DESC_LAYER_SHELL); 142 SWAY_SCENE_DESC_LAYER_SHELL);
143 if (!surface) {
144 continue;
145 }
143 146
144 struct wlr_layer_surface_v1 *layer_surface = surface->layer_surface; 147 struct wlr_layer_surface_v1 *layer_surface = surface->layer_surface;
145 struct wl_resource *resource = layer_surface->resource; 148 struct wl_resource *resource = layer_surface->resource;