Bug Description
The refresh button (view-refresh-symbolic) in the header bar does not reliably re-detect displays after hardware changes (e.g., plugging/unplugging a monitor).
Current Behavior
When clicking refresh, the button:
- Shuts down the DdcService (releasing I2C locks)
- Sleeps 300ms
- Closes all windows
- Calls
build_ui() to rebuild the entire UI
However, users report that the refresh does not properly pick up display changes. This may be because:
- The 300ms sleep may be insufficient for some I2C bus settle times
- Closing and rebuilding the entire window is heavy-handed and may not cleanly reinitialize DDC detection
- The async DDC detection flow (with loading spinner) may not re-trigger properly on rebuild
- DdcService thread state may not be fully cleaned up before re-detection starts
Expected Behavior
Clicking refresh should reliably detect all connected monitors and rebuild the display list with current brightness values.
Steps to Reproduce
- Open Temperlux with monitors connected
- Plug in or unplug a monitor
- Click the refresh button
- Observe that the display list does not correctly reflect the current hardware state
Environment
- Temperlux version: 2.6.1
- Relevant code:
src/gui/window.rs lines 597-616 (refresh button handler)
Investigation Notes
The refresh handler at window.rs:604 shuts down the DdcService, sleeps 300ms, then closes all windows and calls build_ui(). The issue may be in:
- Insufficient delay for I2C bus settling
build_ui() not properly reinitializing the async detection pipeline
- Race condition between window close and DdcService cleanup
Bug Description
The refresh button (view-refresh-symbolic) in the header bar does not reliably re-detect displays after hardware changes (e.g., plugging/unplugging a monitor).
Current Behavior
When clicking refresh, the button:
build_ui()to rebuild the entire UIHowever, users report that the refresh does not properly pick up display changes. This may be because:
Expected Behavior
Clicking refresh should reliably detect all connected monitors and rebuild the display list with current brightness values.
Steps to Reproduce
Environment
src/gui/window.rslines 597-616 (refresh button handler)Investigation Notes
The refresh handler at
window.rs:604shuts down the DdcService, sleeps 300ms, then closes all windows and callsbuild_ui(). The issue may be in:build_ui()not properly reinitializing the async detection pipeline