sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 1b47277962fa04624a0b6835e81089110d258e7c
parent 5cfcd1c7c2ee1e0a199fd5d62b1da962f2102a85
Author: alex-huff <alexhuff@bakahuff.com>
Date:   Wed, 21 May 2025 18:47:10 -0500

layer-shell: reclaim space from unmapped layer surfaces

wlroots resets 'initialized' when a layer surface is unmapped and sway
doesn't rearrange the layer surfaces in response to a commit of a
surface where 'initialized' is false. This results in space not getting
reclaimed from a recently unmapped layer surface until some other action
causes 'arrange_layers' to get called. This commit makes sure all layer
surfaces get rearranged when a layer surface is unmapped.

Diffstat:
Msway/desktop/layer_shell.c | 6+-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c @@ -269,12 +269,8 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) { wl_container_of(listener, surface, surface_commit); struct wlr_layer_surface_v1 *layer_surface = surface->layer_surface; - if (!layer_surface->initialized) { - return; - } - uint32_t committed = layer_surface->current.committed; - if (committed & WLR_LAYER_SURFACE_V1_STATE_LAYER) { + if (layer_surface->initialized && committed & WLR_LAYER_SURFACE_V1_STATE_LAYER) { enum zwlr_layer_shell_v1_layer layer_type = layer_surface->current.layer; struct wlr_scene_tree *output_layer = sway_layer_get_scene( surface->output, layer_type);