Skip to content

config: fix VRR not applying on runtime change#14744

Merged
vaxerski merged 3 commits into
hyprwm:mainfrom
BlueManCZ:fix/misc-vrr-refresh
May 24, 2026
Merged

config: fix VRR not applying on runtime change#14744
vaxerski merged 3 commits into
hyprwm:mainfrom
BlueManCZ:fix/misc-vrr-refresh

Conversation

@BlueManCZ

@BlueManCZ BlueManCZ commented May 21, 2026

Copy link
Copy Markdown
Contributor

Two related fixes for VRR runtime updates via Lua not taking effect until a full config reload:

  1. config/values: misc:vrr was missing a .refresh annotation, so refreshBits() returned 0 and the Lua hl.set path never scheduled a monitor refresh. Tagged with REFRESH_MONITOR_STATES.

  2. config/monitor: hl.monitor({vrr=N}) does schedule a refresh, but PropRefresher's ensureVRR() ran before performMonitorReload had swapped m_activeMonitorRule via applyMonitorRule, so it read the previous VRR setting. Call ensureVRR() again at the end of the reload loop, matching the contract in CMonitor::applyMonitorRule.

Is it ready for merging, or does it need work?

Ready.

`misc:vrr` was missing a `.refresh` annotation, so `refreshBits()` returned 0 and runtime changes via the Lua `hl.set` path never triggered a monitor refresh — the value updated but VRR wasn't applied until a config reload.

Tag the option with `REFRESH_MONITOR_STATES`, which the Lua dynamic-set path schedules (`LuaBindingsConfigRules.cpp`), tripping `PropRefresher` -> `monitorRuleMgr()->ensureVRR()`.
@github-actions

Copy link
Copy Markdown

Hello and thank you for making a PR to Hyprland!

Please check the PR Guidelines and make sure your PR follows them.
It will make the entire review process faster. :)

If your code can be tested, please always add tests. See more here.

beep boop, I'm just a bot. A real human will review your PR soon.

`performMonitorReload` swaps `m_activeMonitorRule` via `applyMonitorRule`, but never re-runs `ensureVRR()` for the now-current rule. The PropRefresher does call `ensureVRR()`, but earlier — before `applyMonitorRule` has updated `m_activeMonitorRule.m_vrr` — so it reads the previous setting and the monitor stays on the old VRR mode.

Call `ensureVRR()` after the reload loop completes, matching the contract documented in `CMonitor::applyMonitorRule` ("will be tested in CConfigManager::ensureVRR()").
@BlueManCZ BlueManCZ changed the title config/values: refresh monitor states on misc:vrr change config: fix VRR not applying on runtime change May 21, 2026
@BlueManCZ
BlueManCZ marked this pull request as draft May 21, 2026 18:28
Signed-off-by: BlueManCZ <ivo97@centrum.cz>
@BlueManCZ
BlueManCZ marked this pull request as ready for review May 21, 2026 18:44
@vaxerski
vaxerski merged commit d5ff0f0 into hyprwm:main May 24, 2026
9 checks passed
ItsOhen pushed a commit to ItsOhen/Hyprland that referenced this pull request Jun 1, 2026
* config/values: refresh monitor states on misc:vrr change

`misc:vrr` was missing a `.refresh` annotation, so `refreshBits()` returned 0 and runtime changes via the Lua `hl.set` path never triggered a monitor refresh — the value updated but VRR wasn't applied until a config reload.

Tag the option with `REFRESH_MONITOR_STATES`, which the Lua dynamic-set path schedules (`LuaBindingsConfigRules.cpp`), tripping `PropRefresher` -> `monitorRuleMgr()->ensureVRR()`.

* config/monitor: call ensureVRR after performMonitorReload

`performMonitorReload` swaps `m_activeMonitorRule` via `applyMonitorRule`, but never re-runs `ensureVRR()` for the now-current rule. The PropRefresher does call `ensureVRR()`, but earlier — before `applyMonitorRule` has updated `m_activeMonitorRule.m_vrr` — so it reads the previous setting and the monitor stays on the old VRR mode.

Call `ensureVRR()` after the reload loop completes, matching the contract documented in `CMonitor::applyMonitorRule` ("will be tested in CConfigManager::ensureVRR()").

* clang-format fix

Signed-off-by: BlueManCZ <ivo97@centrum.cz>

---------

Signed-off-by: BlueManCZ <ivo97@centrum.cz>
Psilocybin78 pushed a commit to Psilocybin78/Singularity-compositor that referenced this pull request Jul 3, 2026
* config/values: refresh monitor states on misc:vrr change

`misc:vrr` was missing a `.refresh` annotation, so `refreshBits()` returned 0 and runtime changes via the Lua `hl.set` path never triggered a monitor refresh — the value updated but VRR wasn't applied until a config reload.

Tag the option with `REFRESH_MONITOR_STATES`, which the Lua dynamic-set path schedules (`LuaBindingsConfigRules.cpp`), tripping `PropRefresher` -> `monitorRuleMgr()->ensureVRR()`.

* config/monitor: call ensureVRR after performMonitorReload

`performMonitorReload` swaps `m_activeMonitorRule` via `applyMonitorRule`, but never re-runs `ensureVRR()` for the now-current rule. The PropRefresher does call `ensureVRR()`, but earlier — before `applyMonitorRule` has updated `m_activeMonitorRule.m_vrr` — so it reads the previous setting and the monitor stays on the old VRR mode.

Call `ensureVRR()` after the reload loop completes, matching the contract documented in `CMonitor::applyMonitorRule` ("will be tested in CConfigManager::ensureVRR()").

* clang-format fix

Signed-off-by: BlueManCZ <ivo97@centrum.cz>

---------

Signed-off-by: BlueManCZ <ivo97@centrum.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants