diff --git a/quickshell/Common/SessionData.qml b/quickshell/Common/SessionData.qml index 5efa7a03..af6d7960 100644 --- a/quickshell/Common/SessionData.qml +++ b/quickshell/Common/SessionData.qml @@ -345,8 +345,8 @@ Singleton { function setLightMode(lightMode) { isSwitchingMode = true; + syncWallpaperForCurrentMode(lightMode); isLightMode = lightMode; - syncWallpaperForCurrentMode(); saveSettings(); Qt.callLater(() => { isSwitchingMode = false; @@ -1112,15 +1112,16 @@ Singleton { saveSettings(); } - function syncWallpaperForCurrentMode() { + function syncWallpaperForCurrentMode(mode) { if (!perModeWallpaper) return; + var light = (mode !== undefined) ? mode : isLightMode; if (perMonitorWallpaper) { - monitorWallpapers = isLightMode ? Object.assign({}, monitorWallpapersLight) : Object.assign({}, monitorWallpapersDark); + monitorWallpapers = light ? Object.assign({}, monitorWallpapersLight) : Object.assign({}, monitorWallpapersDark); return; } - wallpaperPath = isLightMode ? wallpaperPathLight : wallpaperPathDark; + wallpaperPath = light ? wallpaperPathLight : wallpaperPathDark; } function _findMonitorValue(map, screenName) {