Skip to content

fix(wallpaper): fix multi-monitor cycling not working#2042

Merged
bbedward merged 1 commit intoAvengeMedia:masterfrom
beckend:fix-multi-monitor-wallpaper-cycling
Mar 20, 2026
Merged

fix(wallpaper): fix multi-monitor cycling not working#2042
bbedward merged 1 commit intoAvengeMedia:masterfrom
beckend:fix-multi-monitor-wallpaper-cycling

Conversation

@beckend
Copy link
Contributor

@beckend beckend commented Mar 20, 2026

Summary

Fix multi-monitor wallpaper cycling not working due to QML property binding timing issues when dynamically creating timer and process objects.

Root Cause

Multi-monitor wallpaper cycling uses dynamically created QML objects (timers and processes) stored in QML property maps (monitorTimers, monitorProcesses). The original code:

  1. Created object with createObject(root)
  2. Assigned to property map
  3. Read back from property to get reference

This caused issues because QML property assignments don't always evaluate synchronously. Reading back immediately could return undefined or stale values, causing timers and processes to never start.

Single monitor cycling worked fine because it uses statically declared QML objects accessed by ID (no property assignment path).

Changes

  • WallpaperCyclingService.qml:startMonitorCycling() - Fixed timer creation to use local variable reference
  • WallpaperCyclingService.qml:cycleToNextWallpaper() - Fixed process creation to use local variable reference
  • WallpaperCyclingService.qml:cycleToPrevWallpaper() - Fixed process creation to use local variable reference

Verification

Manual testing on NixOS:

  • Enabled per-monitor wallpapers
  • Enabled automatic cycling for multiple monitors
  • Confirmed wallpapers cycle independently on each monitor
  • Confirmed cycling continues working after interval changes
  • Confirmed settings persist correctly in session.json

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
@bbedward bbedward merged commit a53b9af into AvengeMedia:master Mar 20, 2026
2 checks passed
bbedward pushed a commit that referenced this pull request Mar 20, 2026
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
@beckend beckend deleted the fix-multi-monitor-wallpaper-cycling branch March 20, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants