diff options
Diffstat (limited to 'src/config/ConfigManager.cpp')
-rw-r--r-- | src/config/ConfigManager.cpp | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 0e98b977..187d44b6 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -2317,28 +2317,24 @@ void CConfigManager::ensureVRR(CMonitor* pMonitor) { if (USEVRR == 0) { if (m->vrrActive) { - wlr_output_state_set_adaptive_sync_enabled(&m->outputState, 0); + wlr_output_state_set_adaptive_sync_enabled(m->state.wlr(), 0); - if (!wlr_output_commit_state(m->output, &m->outputState)) + if (!m->state.commit()) Debug::log(ERR, "Couldn't commit output {} in ensureVRR -> false", m->output->name); - - pMonitor->clearState(); } m->vrrActive = false; return; } else if (USEVRR == 1) { if (!m->vrrActive) { - wlr_output_state_set_adaptive_sync_enabled(&m->outputState, 1); + wlr_output_state_set_adaptive_sync_enabled(m->state.wlr(), 1); - if (!wlr_output_test_state(m->output, &m->outputState)) { + if (!m->state.test()) { Debug::log(LOG, "Pending output {} does not accept VRR.", m->output->name); - wlr_output_state_set_adaptive_sync_enabled(&m->outputState, 0); + wlr_output_state_set_adaptive_sync_enabled(m->state.wlr(), 0); } - if (!wlr_output_commit_state(m->output, &m->outputState)) + if (!m->state.commit()) Debug::log(ERR, "Couldn't commit output {} in ensureVRR -> true", m->output->name); - - pMonitor->clearState(); } m->vrrActive = true; return; @@ -2354,25 +2350,21 @@ void CConfigManager::ensureVRR(CMonitor* pMonitor) { const auto WORKSPACEFULL = PWORKSPACE->m_bHasFullscreenWindow && PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL; if (WORKSPACEFULL && m->output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_DISABLED) { - wlr_output_state_set_adaptive_sync_enabled(&m->outputState, 1); + wlr_output_state_set_adaptive_sync_enabled(m->state.wlr(), 1); - if (!wlr_output_test_state(m->output, &m->outputState)) { + if (!m->state.test()) { Debug::log(LOG, "Pending output {} does not accept VRR.", m->output->name); - wlr_output_state_set_adaptive_sync_enabled(&m->outputState, 0); + wlr_output_state_set_adaptive_sync_enabled(m->state.wlr(), 0); } - if (!wlr_output_commit_state(m->output, &m->outputState)) + if (!m->state.commit()) Debug::log(ERR, "Couldn't commit output {} in ensureVRR -> true", m->output->name); - pMonitor->clearState(); - } else if (!WORKSPACEFULL && m->output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED) { - wlr_output_state_set_adaptive_sync_enabled(&m->outputState, 0); + wlr_output_state_set_adaptive_sync_enabled(m->state.wlr(), 0); - if (!wlr_output_commit_state(m->output, &m->outputState)) + if (!m->state.commit()) Debug::log(ERR, "Couldn't commit output {} in ensureVRR -> false", m->output->name); - - pMonitor->clearState(); } } }; |