1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 07:52:50 -05:00

wallpaper: encode image URIs

fixes #1306
This commit is contained in:
bbedward
2026-01-08 14:31:48 -05:00
parent f5f21e738a
commit a21a846bf5
11 changed files with 131 additions and 117 deletions

View File

@@ -39,6 +39,12 @@ Variants {
id: root
anchors.fill: parent
function encodeFileUrl(path) {
if (!path)
return "";
return "file://" + path.split('/').map(s => encodeURIComponent(s)).join('/');
}
property string source: SessionData.getMonitorWallpaper(modelData.name) || ""
property bool isColorSource: source.startsWith("#")
property string transitionType: SessionData.wallpaperTransition
@@ -108,7 +114,7 @@ Variants {
isInitialized = true;
return;
}
const formattedSource = source.startsWith("file://") ? source : "file://" + source;
const formattedSource = source.startsWith("file://") ? source : encodeFileUrl(source);
setWallpaperImmediate(formattedSource);
isInitialized = true;
}
@@ -119,7 +125,7 @@ Variants {
return;
}
const formattedSource = source.startsWith("file://") ? source : "file://" + source;
const formattedSource = source.startsWith("file://") ? source : encodeFileUrl(source);
if (!isInitialized || !currentWallpaper.source) {
setWallpaperImmediate(formattedSource);