1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-14 09:42:10 -04:00

wallpaper: fix per-monitor view modes

fixes #1582
This commit is contained in:
bbedward
2026-02-11 17:58:44 -05:00
parent 0133c19276
commit 1a9d7684b9
7 changed files with 143 additions and 107 deletions

View File

@@ -45,11 +45,12 @@ Singleton {
if (typeof SessionData === "undefined")
return "";
var monitors = SessionData.monitorWallpapers;
if (SessionData.perMonitorWallpaper) {
var screens = Quickshell.screens;
if (screens.length > 0) {
var firstMonitorWallpaper = SessionData.getMonitorWallpaper(screens[0].name);
return firstMonitorWallpaper || SessionData.wallpaperPath;
var s = screens[0];
return monitors[s.name] || (s.model ? monitors[s.model] : "") || SessionData.wallpaperPath;
}
}
@@ -59,6 +60,7 @@ Singleton {
if (typeof SessionData === "undefined")
return "";
var monitors = SessionData.monitorWallpapers;
if (SessionData.perMonitorWallpaper) {
var screens = Quickshell.screens;
if (screens.length > 0) {
@@ -72,12 +74,20 @@ Singleton {
}
}
if (!targetMonitorExists) {
if (!targetMonitorExists)
targetMonitor = screens[0].name;
var s = null;
for (var j = 0; j < screens.length; j++) {
if (screens[j].name === targetMonitor) {
s = screens[j];
break;
}
}
var targetMonitorWallpaper = SessionData.getMonitorWallpaper(targetMonitor);
return targetMonitorWallpaper || SessionData.wallpaperPath;
if (s)
return monitors[s.name] || (s.model ? monitors[s.model] : "") || SessionData.wallpaperPath;
return monitors[targetMonitor] || SessionData.wallpaperPath;
}
}