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