aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kirill Primak <vyivel@eclair.cafe>2024-01-17 18:51:21 +0300
committerLibravatar Simon Ser <contact@emersion.fr>2024-01-17 16:54:37 +0100
commit2c69e19fd30c5ceac61d6af821c6c6875cd3f8b6 (patch)
tree62ee45e06e67a3c095250ae355db998b49d33244
parentlayer-shell: wait for an initial commit before configuring (diff)
downloadsway-2c69e19fd30c5ceac61d6af821c6c6875cd3f8b6.tar.gz
sway-2c69e19fd30c5ceac61d6af821c6c6875cd3f8b6.tar.zst
sway-2c69e19fd30c5ceac61d6af821c6c6875cd3f8b6.zip
layer-shell: don't configure uninitialized surfaces
-rw-r--r--sway/desktop/layer_shell.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index d493fb39..e5e7046a 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -131,6 +131,9 @@ static void arrange_layer(struct sway_output *output, struct wl_list *list,
131 &full_area.width, &full_area.height); 131 &full_area.width, &full_area.height);
132 wl_list_for_each(sway_layer, list, link) { 132 wl_list_for_each(sway_layer, list, link) {
133 struct wlr_layer_surface_v1 *layer = sway_layer->layer_surface; 133 struct wlr_layer_surface_v1 *layer = sway_layer->layer_surface;
134 if (!layer->initialized) {
135 return;
136 }
134 struct wlr_layer_surface_v1_state *state = &layer->current; 137 struct wlr_layer_surface_v1_state *state = &layer->current;
135 if (exclusive != (state->exclusive_zone > 0)) { 138 if (exclusive != (state->exclusive_zone > 0)) {
136 continue; 139 continue;
@@ -327,6 +330,8 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) {
327 330
328 if (layer_surface->initial_commit) { 331 if (layer_surface->initial_commit) {
329 surface_enter_output(layer_surface->surface, output); 332 surface_enter_output(layer_surface->surface, output);
333 } else if (!layer_surface->initialized) {
334 return;
330 } 335 }
331 336
332 struct wlr_box old_extent = layer->extent; 337 struct wlr_box old_extent = layer->extent;