From 1bb9c4583a4e5b0975ed9b57e994f1d958f04c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Sat, 10 Sep 2022 18:41:39 -0500 Subject: [PATCH] fix exclusive zone of unmapped layer surfaces Fixes: https://github.com/djpohly/dwl/issues/302 --- dwl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dwl.c b/dwl.c index 912a877..7c3855d 100644 --- a/dwl.c +++ b/dwl.c @@ -522,7 +522,8 @@ arrangelayer(Monitor *m, struct wl_list *list, struct wlr_box *usable_area, int const uint32_t both_vert = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; - if (wlr_layer_surface->mapped && exclusive != (state->exclusive_zone > 0)) + if (!((LayerSurface *)wlr_layer_surface->data)->mapped + || exclusive != (state->exclusive_zone > 0)) continue; bounds = state->exclusive_zone == -1 ? full_area : *usable_area; @@ -901,6 +902,7 @@ createlayersurface(struct wl_listener *listener, void *data) */ old_state = wlr_layer_surface->current; wlr_layer_surface->current = wlr_layer_surface->pending; + layersurface->mapped = 1; arrangelayers(layersurface->mon); wlr_layer_surface->current = old_state; } @@ -2312,7 +2314,7 @@ unmaplayersurfacenotify(struct wl_listener *listener, void *data) { LayerSurface *layersurface = wl_container_of(listener, layersurface, unmap); - layersurface->layer_surface->mapped = (layersurface->mapped = 0); + layersurface->mapped = 0; wlr_scene_node_set_enabled(layersurface->scene, 0); if (layersurface->layer_surface->output && (layersurface->mon = layersurface->layer_surface->output->data))