Apply native wallpapers to every output when they share a file
The decode check bound its source to the pending request, so a second output using the same file never reloaded it and was silently skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
47a7576d46
commit
728a9d336c
1 file changed
+10
-5
@@ -107,8 +107,12 @@ Singleton {
|
||||
root.queue = [];
|
||||
return;
|
||||
}
|
||||
if(result.backend === "native") root.nativePending = {request:request,result:result};
|
||||
else root.finishApply(request,result);
|
||||
if(result.backend === "native") {
|
||||
// Reload even when the previous output used the same file, so every output gets its decode check.
|
||||
root.nativePending = {request:request,result:result};
|
||||
decodeCheck.source = "";
|
||||
decodeCheck.source = result.url;
|
||||
} else root.finishApply(request,result);
|
||||
}
|
||||
}
|
||||
function finishApply(request,result) {
|
||||
@@ -124,14 +128,15 @@ Singleton {
|
||||
ConfigService.setValue("wallpaper.history",[result.path].concat(ConfigService.data.wallpaper.history.filter(p=>p!==result.path)).slice(0,50));
|
||||
Qt.callLater(root.applyNext);
|
||||
}
|
||||
// Confirms a native wallpaper decodes before it is saved; set imperatively by applyJob.
|
||||
Image {
|
||||
id: decodeCheck
|
||||
visible:false
|
||||
asynchronous:true
|
||||
sourceSize:Qt.size(32,32)
|
||||
source:root.nativePending ? root.nativePending.result.url : ""
|
||||
onStatusChanged: {
|
||||
if(!root.nativePending)return;
|
||||
if(status===Image.Ready) {const pending=root.nativePending;root.nativePending=null;root.finishApply(pending.request,pending.result);}
|
||||
if(!root.nativePending || source.toString()!==root.nativePending.result.url)return;
|
||||
if(status===Image.Ready) {const pending=root.nativePending;root.nativePending=null;Qt.callLater(()=>root.finishApply(pending.request,pending.result));}
|
||||
else if(status===Image.Error) {root.error="Could not decode this wallpaper";root.nativePending=null;root.queue=[];}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user