From 4773202ab0a3cb25699484f8b6221c7dd8cfd95b Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 22 Jun 2026 19:57:05 +0200 Subject: [PATCH] Apply pending shell theme after background polling --- shell/plugins/background/Background.qml | 4 +++- test/shell.d/background-test.sh | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/shell/plugins/background/Background.qml b/shell/plugins/background/Background.qml index e7f8ccfa..f33cb136 100644 --- a/shell/plugins/background/Background.qml +++ b/shell/plugins/background/Background.qml @@ -70,7 +70,9 @@ Item { } function applyPendingTheme() { - if (pendingThemeVersion !== backgroundVersion) return + // Background polling can advance backgroundVersion while a theme switch is + // pending; the latest theme payload should still apply. + if (pendingThemeVersion < 0) return pendingThemeFallbackTimer.stop() Color.loadColors(pendingColorsRaw) // Color.loadShell also refreshes Style so the type scale flips with the diff --git a/test/shell.d/background-test.sh b/test/shell.d/background-test.sh index 3a502a6a..9762e6d3 100644 --- a/test/shell.d/background-test.sh +++ b/test/shell.d/background-test.sh @@ -14,7 +14,8 @@ assert( assert( backgroundQml.includes('pendingThemeFallbackTimer.restart()') && backgroundQml.includes('pendingThemeFallbackTimer.stop()') && - backgroundQml.includes('id: pendingThemeFallbackTimer'), + backgroundQml.includes('id: pendingThemeFallbackTimer') && + !backgroundQml.includes('pendingThemeVersion !== backgroundVersion'), 'background theme transition applies pending colors even if image reveal stalls' ) JS