From 0d352dff09bab4536d2e182538641af1c6d2a1ef Mon Sep 17 00:00:00 2001 From: chayleaf Date: Wed, 14 Aug 2024 07:32:11 +0700 Subject: [PATCH 2/2] mobile: reverse layer order This makes exclusive anchored layers that were added first be first --- sway/desktop/layer_shell.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index 8c6cedfe..4afca0b7 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c @@ -129,7 +129,7 @@ static void arrange_layer(struct sway_output *output, struct wl_list *list, struct wlr_box full_area = { 0 }; wlr_output_effective_resolution(output->wlr_output, &full_area.width, &full_area.height); - wl_list_for_each(sway_layer, list, link) { + wl_list_for_each_reverse(sway_layer, list, link) { struct wlr_layer_surface_v1 *layer = sway_layer->layer_surface; struct wlr_layer_surface_v1_state *state = &layer->current; if (exclusive != (state->exclusive_zone > 0)) { @@ -214,14 +214,14 @@ void arrange_layers(struct sway_output *output) { wlr_output_effective_resolution(output->wlr_output, &usable_area.width, &usable_area.height); - // Arrange exclusive surfaces from top->bottom - arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], - &usable_area, true); - arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], + // Arrange exclusive surfaces from bottom->top + arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], &usable_area, true); arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], &usable_area, true); - arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], + arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], + &usable_area, true); + arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], &usable_area, true); if (memcmp(&usable_area, &output->usable_area, -- 2.44.1