mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-03 13:41:59 -07:00
disable adaptive sync with no_vfr off
This commit is contained in:
@@ -1204,6 +1204,7 @@ void CConfigManager::loadConfigLoadVars() {
|
||||
|
||||
// check
|
||||
ensureDPMS();
|
||||
ensureVRR();
|
||||
}
|
||||
|
||||
// Update window border colors
|
||||
@@ -1535,6 +1536,40 @@ void CConfigManager::ensureDPMS() {
|
||||
}
|
||||
}
|
||||
|
||||
void CConfigManager::ensureVRR() {
|
||||
static auto *const PNOVRR = &getConfigValuePtr("misc:no_vfr")->intValue;
|
||||
|
||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||
if (!*PNOVRR && !m->vrrActive) {
|
||||
// Adaptive sync (VRR)
|
||||
wlr_output_enable_adaptive_sync(m->output, 1);
|
||||
|
||||
if (!wlr_output_test(m->output)) {
|
||||
Debug::log(LOG, "Pending output %s does not accept VRR.", m->output->name);
|
||||
wlr_output_enable_adaptive_sync(m->output, 0);
|
||||
}
|
||||
|
||||
if (!wlr_output_commit(m->output)) {
|
||||
Debug::log(ERR, "Couldn't commit output %s in ensureVRR -> true", m->output->name);
|
||||
}
|
||||
|
||||
m->vrrActive = true;
|
||||
|
||||
Debug::log(LOG, "VRR ensured on %s -> true", m->output->name);
|
||||
} else if (*PNOVRR && m->vrrActive) {
|
||||
wlr_output_enable_adaptive_sync(m->output, 0);
|
||||
|
||||
if (!wlr_output_commit(m->output)) {
|
||||
Debug::log(ERR, "Couldn't commit output %s in ensureVRR -> false", m->output->name);
|
||||
}
|
||||
|
||||
m->vrrActive = false;
|
||||
|
||||
Debug::log(LOG, "VRR ensured on %s -> false", m->output->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SAnimationPropertyConfig* CConfigManager::getAnimationPropertyConfig(const std::string& name) {
|
||||
return &animationConfig[name];
|
||||
}
|
||||
|
Reference in New Issue
Block a user