From b9336d59304856126b3f94ed69b60cb89913b43f Mon Sep 17 00:00:00 2001 From: Gabriel Brown Date: Tue, 18 Aug 2026 14:31:12 -0400 Subject: [PATCH] Restore complete wallpaper policies --- config/dot/quickshell/services/SettingsBackup.qml | 11 +++++------ config/dot/quickshell/settings-backup-harness.qml | 4 ++-- tests/quickshell/settings-backup-live-contract.sh | 6 +++--- tests/quickshell/settings-commit-reset-contract.sh | 7 ++++++- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/config/dot/quickshell/services/SettingsBackup.qml b/config/dot/quickshell/services/SettingsBackup.qml index 58a2868..59a4719 100644 --- a/config/dot/quickshell/services/SettingsBackup.qml +++ b/config/dot/quickshell/services/SettingsBackup.qml @@ -46,10 +46,8 @@ Singleton { property var reloadKeybinds: function() { Keybinds.applyReload(); } property var keybindsReloading: function() { return Keybinds.reloading; } property var systemBusy: function() { return SystemSettings.busy; } - property var currentWallpaper: function() { - return String(DesktopPreferences.get("wallpaperPath") ?? ""); - } - property var applyWallpaper: function(path) { Wallpaper.set(path); } + property var applyWallpaperPolicy: function() { Wallpaper.applyCurrentPolicy(false); } + property var wallpaperBusy: function() { return Wallpaper.busy; } property var regenerateLock: function() { LockScreen.regenerate(); } property var lockBusy: function() { return LockScreen.busy; } property var reloadShell: function() { Quickshell.reload(false); } @@ -120,7 +118,7 @@ Singleton { // replay: compositor options, Lua-generated binds, and hyprpaper. root.applyCompositor(); root.reloadKeybinds(); - root.applyWallpaper(root.currentWallpaper()); + root.applyWallpaperPolicy(); root.regenerateLock(); settleReload.attempts = 0; @@ -138,7 +136,8 @@ Singleton { // Let the current instances finish their external writes before a // soft reload replaces them. The cap keeps a failed external tool // from leaving restored Home state stale indefinitely. - if ((!root.keybindsReloading() && !root.systemBusy() && !root.lockBusy()) || attempts >= 30) { + if ((!root.keybindsReloading() && !root.systemBusy() + && !root.wallpaperBusy() && !root.lockBusy()) || attempts >= 30) { stop(); root.setDisplayBlocked(false); root.protectedDisplays = ({}); diff --git a/config/dot/quickshell/settings-backup-harness.qml b/config/dot/quickshell/settings-backup-harness.qml index 8f06a4b..2b06453 100644 --- a/config/dot/quickshell/settings-backup-harness.qml +++ b/config/dot/quickshell/settings-backup-harness.qml @@ -61,8 +61,8 @@ ShellRoot { SettingsBackup.reloadKeybinds = function() { root.record("keybinds.reload"); }; SettingsBackup.keybindsReloading = function() { return false; }; SettingsBackup.systemBusy = function() { return false; }; - SettingsBackup.currentWallpaper = function() { return "/tmp/restored-wallpaper.jpg"; }; - SettingsBackup.applyWallpaper = function(path) { root.record("wallpaper.set:" + path); }; + SettingsBackup.applyWallpaperPolicy = function() { root.record("wallpaper.apply-policy"); }; + SettingsBackup.wallpaperBusy = function() { return false; }; SettingsBackup.regenerateLock = function() { root.record("lock.regenerate"); }; SettingsBackup.lockBusy = function() { return false; }; SettingsBackup.reloadShell = function() { root.record("shell.reload"); }; diff --git a/tests/quickshell/settings-backup-live-contract.sh b/tests/quickshell/settings-backup-live-contract.sh index 975d28d..adee5e9 100755 --- a/tests/quickshell/settings-backup-live-contract.sh +++ b/tests/quickshell/settings-backup-live-contract.sh @@ -47,7 +47,7 @@ for mapping in \ 'Displays.externalChangeBlocked = blocked;' \ 'SystemSettings.applyPersistedDisplayPolicy();' \ 'Keybinds.applyReload();' \ - 'Wallpaper.set(path);' \ + 'Wallpaper.applyCurrentPolicy(false);' \ 'LockScreen.regenerate();' \ 'Quickshell.reload(false);'; do rg -Fq "$mapping" "$service" || fail "production restore seam is missing: $mapping" @@ -88,7 +88,7 @@ jq -e ' "display.protect:{\"DP-2\":{\"mode\":\"4500x3000@60\",\"scale\":1.5,\"transform\":0}}", "system.apply", "keybinds.reload", - "wallpaper.set:/tmp/restored-wallpaper.jpg", + "wallpaper.apply-policy", "lock.regenerate", "display.block:false", "shell.reload" @@ -127,7 +127,7 @@ jq -e ' "display.protect:{\"DP-2\":{\"mode\":\"4500x3000@60\",\"scale\":1.5,\"transform\":0}}", "system.apply", "keybinds.reload", - "wallpaper.set:/tmp/restored-wallpaper.jpg", + "wallpaper.apply-policy", "lock.regenerate", "display.block:false", "shell.reload" diff --git a/tests/quickshell/settings-commit-reset-contract.sh b/tests/quickshell/settings-commit-reset-contract.sh index fcb9cea..4dde3fd 100755 --- a/tests/quickshell/settings-commit-reset-contract.sh +++ b/tests/quickshell/settings-commit-reset-contract.sh @@ -49,7 +49,7 @@ rg -Fq 'LockScreen.regenerate();' "$system_settings" \ || fail 'restoreDefaults does not regenerate the shipped lock screen' rg -Fq 'const effectivePath = path === "" ? root.shippedPath : path;' "$wallpaper_service" \ || fail 'clearing wallpaper preference leaves the old image visible' -rg -Fq 'property string storedValue:' "$wallpaper_service" \ +rg -Fq 'storedPath: rawGlobal === root.shippedPath ? "" : rawGlobal' "$wallpaper_service" \ || fail 'the shipped wallpaper cannot remain represented by the default empty preference' qs_for_harness() { @@ -149,6 +149,11 @@ jq -e '.calls == [ [[ "$(qs_for_harness ipc call settings-system-test stored dockHideDelayMs)" == "250" ]] \ || fail 'reset did not restore a schema default' for default_case in \ + 'wallpaperMode|"single"' \ + 'wallpaperSlideshowPaths|[]' \ + 'wallpaperIntervalMinutes|30' \ + 'wallpaperShuffle|true' \ + 'wallpaperPerMonitor|{}' \ 'lockBackgroundMode|"screenshot"' \ 'lockBlurLevel|3' \ 'lockShowClock|true' \