aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/appearance/Wallpapers.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/modules/appearance/Wallpapers.qml')
-rw-r--r--desktop/modules/appearance/Wallpapers.qml32
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 }