aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralex-huff <alexhuff@bakahuff.com>2025-05-21 18:47:10 -0500
committerAlexander Orzechowski <alex@ozal.ski>2025-05-21 20:33:27 -0400
commit1b47277962fa04624a0b6835e81089110d258e7c (patch)
tree99f38c0099d0bec4966c3fe1d6937f4a590312b3
parent5cfcd1c7c2ee1e0a199fd5d62b1da962f2102a85 (diff)
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.
-rw-r--r--sway/desktop/layer_shell.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index b14a9a4b..08b5b1de 100644
--- 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);