From d2031ba3849ec712a9cf2a99676f53d8679de4a5 Mon Sep 17 00:00:00 2001 From: LunaDL <91587464+EnzoDLofi@users.noreply.github.com> Date: Sun, 29 Nov 2026 01:43:57 -0400 Subject: [PATCH] Fix deferred layer hide when callback allocation fails --- app/src/main/cpp/waylandcomp/src/sc_layer.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/cpp/waylandcomp/src/sc_layer.c b/app/src/main/cpp/waylandcomp/src/sc_layer.c index a0e3df4941..546ea82f40 100644 --- a/app/src/main/cpp/waylandcomp/src/sc_layer.c +++ b/app/src/main/cpp/waylandcomp/src/sc_layer.c @@ -1235,9 +1235,16 @@ static int hide_layer(struct layer *l) { replace_with_blank(tx, l); api.setVisibility(tx, l->sc, ASC_VISIBILITY_HIDE); if (add_complete(tx, l, l->cur_slot, l->cur_token, 0) != 0) { + /* + * Hiding does not require a release callback. Apply the visibility + * change now, but keep the current slot/token pinned until a later + * presentation or retirement can attach a completion callback. + */ + api.txApply(tx); api.txDelete(tx); - droiddeck_log("layer", "%s: hide deferred because its release callback could not be allocated", l->name); - return -1; + l->shown = 0; + droiddeck_log("layer", "%s: hidden; buffer release deferred because its callback could not be allocated", l->name); + return 0; } api.txApply(tx); api.txDelete(tx); l->shown = 0; l->cur_slot = -1; l->cur_token = NULL;