diff --git a/quickshell/services/WallpaperService.qml b/quickshell/services/WallpaperService.qml index 8e50468..273c77e 100644 --- a/quickshell/services/WallpaperService.qml +++ b/quickshell/services/WallpaperService.qml @@ -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=[];} } }