mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-03 20:32:07 -04:00
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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user