From a53b9afb444e0d8b9604c9abf2703dfa6a7d450d Mon Sep 17 00:00:00 2001 From: Linken Quy Dinh Date: Sat, 21 Mar 2026 04:38:36 +0700 Subject: [PATCH] fix: multi-monitor wallpaper cycling not working (#2042) Fixed a QML property binding timing issue where dynamically created timers and processes for per-monitor wallpaper cycling were being assigned to properties and then immediately read back, which could return undefined or stale values. The fix stores the created object in a local variable before assigning to the property map, ensuring a valid reference is always used. Affected functions: - startMonitorCycling() - timer creation - cycleToNextWallpaper() - process creation - cycleToPrevWallpaper() - process creation --- quickshell/Services/WallpaperCyclingService.qml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/quickshell/Services/WallpaperCyclingService.qml b/quickshell/Services/WallpaperCyclingService.qml index 00528e49..a07c563f 100644 --- a/quickshell/Services/WallpaperCyclingService.qml +++ b/quickshell/Services/WallpaperCyclingService.qml @@ -194,10 +194,11 @@ Singleton { var timer = monitorTimers[screenName]; if (!timer && monitorTimerComponent && monitorTimerComponent.status === Component.Ready) { var newTimers = Object.assign({}, monitorTimers); - newTimers[screenName] = monitorTimerComponent.createObject(root); - newTimers[screenName].targetScreen = screenName; + var newTimer = monitorTimerComponent.createObject(root); + newTimer.targetScreen = screenName; + newTimers[screenName] = newTimer; monitorTimers = newTimers; - timer = monitorTimers[screenName]; + timer = newTimer; } if (timer) { timer.interval = settings.interval * 1000; @@ -258,9 +259,10 @@ Singleton { var process = monitorProcesses[screenName]; if (!process) { var newProcesses = Object.assign({}, monitorProcesses); - newProcesses[screenName] = monitorProcessComponent.createObject(root); + var newProcess = monitorProcessComponent.createObject(root); + newProcesses[screenName] = newProcess; monitorProcesses = newProcesses; - process = monitorProcesses[screenName]; + process = newProcess; } if (process) { @@ -290,9 +292,10 @@ Singleton { var process = monitorProcesses[screenName]; if (!process) { var newProcesses = Object.assign({}, monitorProcesses); - newProcesses[screenName] = monitorProcessComponent.createObject(root); + var newProcess = monitorProcessComponent.createObject(root); + newProcesses[screenName] = newProcess; monitorProcesses = newProcesses; - process = monitorProcesses[screenName]; + process = newProcess; } if (process) {