mirror of
https://github.com/hyprwm/Hyprland.git
synced 2026-09-28 01:46:17 -04:00
config: fix VRR not applying on runtime change (#14744)
* 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>
This commit is contained in:
@@ -144,6 +144,8 @@ void CMonitorRuleManager::performMonitorReload() {
|
||||
|
||||
m_reloadScheduled = false;
|
||||
|
||||
ensureVRR();
|
||||
|
||||
Event::bus()->m_events.monitor.layoutChanged.emit();
|
||||
}
|
||||
|
||||
|
||||
@@ -456,7 +456,7 @@ std::vector<SP<IValue>> Values::getConfigValues() {
|
||||
MS<String>("misc:splash_font_family", "Changes the font used to render the splash text.", "[[EMPTY]]"),
|
||||
MS<Int>("misc:force_default_wallpaper", "Force any of the 3 default wallpapers. [-1/0/1/2]", -1, {.min = -1, .max = 2}),
|
||||
MS<Int>("misc:vrr", "controls the VRR (Adaptive Sync) of your monitors", 0,
|
||||
{.min = 0, .max = 3, .map = OptionMap{{"off", 0}, {"on", 1}, {"fullscreen", 2}, {"fullscreen_game", 3}}}),
|
||||
{.min = 0, .max = 3, .map = OptionMap{{"off", 0}, {"on", 1}, {"fullscreen", 2}, {"fullscreen_game", 3}}, .refresh = Supplementary::REFRESH_MONITOR_STATES}),
|
||||
MS<Bool>("misc:mouse_move_enables_dpms", "If DPMS is set to off, wake up the monitors if the mouse moves", false),
|
||||
MS<Bool>("misc:key_press_enables_dpms", "If DPMS is set to off, wake up the monitors if a key is pressed.", false),
|
||||
MS<Bool>("misc:name_vk_after_proc", "Name virtual keyboards after the processes that create them.", true),
|
||||
|
||||
Reference in New Issue
Block a user