diff options
author | Ikalco <[email protected]> | 2024-11-01 07:30:26 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2024-11-01 12:30:26 +0000 |
commit | c4d214c42d743a69f606ff476b7266b3ace7d70e (patch) | |
tree | 64e54102a0593cdc61ebc307125ace96bcad4c3d | |
parent | 93b4478e70af6ffb08a4a66a6d0364c3296db296 (diff) | |
download | Hyprland-c4d214c42d743a69f606ff476b7266b3ace7d70e.tar.gz Hyprland-c4d214c42d743a69f606ff476b7266b3ace7d70e.zip |
monitors: fix vrr breaking monitor disconnect (#8314)
-rw-r--r-- | src/config/ConfigManager.cpp | 8 | ||||
-rw-r--r-- | src/helpers/Monitor.cpp | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index f1ba8d7f..62c71dc7 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1608,9 +1608,6 @@ void CConfigManager::ensureVRR(PHLMONITOR pMonitor) { m->vrrActive = true; return; } else if (USEVRR == 2) { - /* fullscreen */ - m->vrrActive = true; - const auto PWORKSPACE = m->activeWorkspace; if (!PWORKSPACE) @@ -1619,6 +1616,9 @@ void CConfigManager::ensureVRR(PHLMONITOR pMonitor) { const auto WORKSPACEFULL = PWORKSPACE->m_bHasFullscreenWindow && (PWORKSPACE->m_efFullscreenMode & FSMODE_FULLSCREEN); if (WORKSPACEFULL) { + /* fullscreen */ + m->vrrActive = true; + m->output->state->resetExplicitFences(); m->output->state->setAdaptiveSync(true); @@ -1631,6 +1631,8 @@ void CConfigManager::ensureVRR(PHLMONITOR pMonitor) { Debug::log(ERR, "Couldn't commit output {} in ensureVRR -> true", m->output->name); } else if (!WORKSPACEFULL) { + m->vrrActive = false; + m->output->state->resetExplicitFences(); m->output->state->setAdaptiveSync(false); diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 9e71bf5f..bfab2fd3 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -334,6 +334,7 @@ void CMonitor::onDisconnect(bool destroy) { activeWorkspace.reset(); output->state->resetExplicitFences(); + output->state->setAdaptiveSync(false); output->state->setEnabled(false); if (!state.commit()) |