From cdd833facb7cefff39019958aeb0246464ea6d86 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 22 Jun 2026 19:52:35 +0200 Subject: [PATCH] Apply shell theme if background reveal stalls --- shell/plugins/background/Background.qml | 9 +++++++++ test/shell.d/background-test.sh | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/shell/plugins/background/Background.qml b/shell/plugins/background/Background.qml index 079afd28..e7f8ccfa 100644 --- a/shell/plugins/background/Background.qml +++ b/shell/plugins/background/Background.qml @@ -66,10 +66,12 @@ Item { pendingColorsRaw = Util.decodeBase64(colorsB64) pendingShellRaw = Util.decodeBase64(shellB64) pendingThemeVersion = backgroundVersion + pendingThemeFallbackTimer.restart() } function applyPendingTheme() { if (pendingThemeVersion !== backgroundVersion) return + pendingThemeFallbackTimer.stop() Color.loadColors(pendingColorsRaw) // Color.loadShell also refreshes Style so the type scale flips with the // background reveal instead of waiting for a separate reload path. @@ -154,6 +156,13 @@ Item { onTriggered: root.refreshBackground() } + Timer { + id: pendingThemeFallbackTimer + interval: 300 + repeat: false + onTriggered: root.applyPendingTheme() + } + NumberAnimation { id: revealAnimation target: root diff --git a/test/shell.d/background-test.sh b/test/shell.d/background-test.sh index db512476..3a502a6a 100644 --- a/test/shell.d/background-test.sh +++ b/test/shell.d/background-test.sh @@ -10,4 +10,11 @@ assert( /theme=\$\(omarchy-theme-switcher\); \[\[ -n \$theme \]\] && omarchy-theme-set \\"\$theme\\" >\/dev\/null 2>&1 &/.test(backgroundQml), 'background theme switcher starts theme application asynchronously after selection' ) + +assert( + backgroundQml.includes('pendingThemeFallbackTimer.restart()') && + backgroundQml.includes('pendingThemeFallbackTimer.stop()') && + backgroundQml.includes('id: pendingThemeFallbackTimer'), + 'background theme transition applies pending colors even if image reveal stalls' +) JS