diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-29 17:17:09 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-29 17:17:09 +0100 |
| commit | 52e8897f1edd2d06e98a1e9162f3ff98e82cf921 (patch) | |
| tree | 681ac59482eb75557bba1ff2d397b73fedf81888 /desktop/modules/appearance/Wallpapers.qml | |
| parent | 670452de94e0f3e0bf5719acec28a9b02e929642 (diff) | |
| download | quickshell-52e8897f1edd2d06e98a1e9162f3ff98e82cf921.tar.gz quickshell-52e8897f1edd2d06e98a1e9162f3ff98e82cf921.zip | |
wallpaper: start wallp only once the burn's cover is on screen
The new wallpaper flashed in for a moment, the old one came back over
it, and only then did it burn. run() started wallp in the same turn as
swapping, while the cover was still mapping and decoding its two
pictures asynchronously, so swaybg swapped under an empty cover.
run() now holds wallp until each cover reports it is drawing (its
pictures decoded, then 50ms for a few frames), with a 1.5s fallback for
a cover that never comes: a missing screen or a picture that fails to
load. A run with nothing to cover starts at once, as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/appearance/Wallpapers.qml')
| -rw-r--r-- | desktop/modules/appearance/Wallpapers.qml | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/desktop/modules/appearance/Wallpapers.qml b/desktop/modules/appearance/Wallpapers.qml index 5507476..4d06a2e 100644 --- a/desktop/modules/appearance/Wallpapers.qml +++ b/desktop/modules/appearance/Wallpapers.qml @@ -244,17 +244,43 @@ Singleton { if (applying || (h === "" && v === "")) return false; applying = true; root.kind = kind; - if (h !== "" && currentH !== "" && h !== currentH) swapping("H", currentH, h); - if (v !== "" && currentV !== "" && v !== currentV) swapping("V", currentV, v); + let covers = 0; + if (h !== "" && currentH !== "" && h !== currentH) { covers++; swapping("H", currentH, h); } + if (v !== "" && currentV !== "" && v !== currentV) { covers++; swapping("V", currentV, v); } const args = []; if (h !== "") args.push(`H=${JSON.stringify(h)}`); if (v !== "") args.push(`V=${JSON.stringify(v)}`); const env = kind === "tick" ? "UDT_ROTATION=1 " : ""; applyProc.command = ["sh", "-c", `${env}wallp --set ${args.join(" ")} >/dev/null 2>&1`]; - applyProc.running = true; + uncovered = covers; + if (covers === 0) applyProc.running = true; + else coverWait.restart(); return true; } + // Covers still to come up before wallp may swap swaybg under them. The + // cover decodes its pictures asynchronously, and starting wallp with + // swapping showed the new picture through the still empty cover for a + // moment, then the old one over it, then the burn. WallpaperSpread + // calls covered() once it is drawing; a cover that never comes (a + // screen missing, a picture that fails to load) is waited out. + property int uncovered: 0 + function covered() { + if (uncovered === 0) return; + if (--uncovered === 0) { + coverWait.stop(); + applyProc.running = true; + } + } + Timer { + id: coverWait + interval: 1500 + onTriggered: if (root.uncovered > 0) { + root.uncovered = 0; + applyProc.running = true; + } + } + Process { id: applyProc stderr: StdioCollector { id: applyErr } |
