From c00746c1112fb8420126ff2834351ed245b3d618 Mon Sep 17 00:00:00 2001 From: Stacy Harper Date: Mon, 13 Dec 2021 18:25:05 +0100 Subject: [PATCH] Prevent a layer shell infinite looping case This commit try to fix a case we encounter when running swayout, a layer shell to display text above the background. When running wayout, other layer shell start to consume 100% of the CPU. This seems related to a previous fix 744e85b. Then later, another commit reworks this handle_surface_commit method 5fd5d643. This is a tentative to fix the issue without missing the points of those patches. We basically try to not re-arrange layers if no layer changed. --- sway/desktop/layer_shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index db78b59f6..3b31dcff0 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c @@ -308,8 +308,8 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) { wl_list_insert(&output->layers[layer_surface->current.layer], &layer->link); layer->layer = layer_surface->current.layer; + arrange_layers(output); } - arrange_layers(output); } wlr_surface_get_extends(layer_surface->surface, &layer->extent);