diff options
| author | Alessio Molinari <alessio.molinari@strg.at> | 2024-05-23 21:15:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-23 21:15:31 +0200 |
| commit | eea0a6a70412574baabea2b83d2c52003c98d46f (patch) | |
| tree | ba6e34a3d6c3bd0b71fd711ab0c5dc9dc3c4838d /src/protocols/OutputManagement.cpp | |
| parent | 255272ea18a1bd899168b2d2063b6f153edda919 (diff) | |
internal: Replace monitor rule when disabling head. (#6136)
Closes #5978
Diffstat (limited to 'src/protocols/OutputManagement.cpp')
| -rw-r--r-- | src/protocols/OutputManagement.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/protocols/OutputManagement.cpp b/src/protocols/OutputManagement.cpp index e7779726..68c50193 100644 --- a/src/protocols/OutputManagement.cpp +++ b/src/protocols/OutputManagement.cpp @@ -106,6 +106,9 @@ COutputHead::COutputHead(SP<CZwlrOutputHeadV1> resource_, CMonitor* pMonitor_) : } pMonitor = nullptr; + for (auto& m : PROTO::outputManagement->m_vManagers) { + m->sendDone(); + } }); listeners.monitorModeChange = pMonitor->events.modeChanged.registerListener([this](std::any d) { updateMode(); }); @@ -305,6 +308,8 @@ COutputConfiguration::COutputConfiguration(SP<CZwlrOutputConfigurationV1> resour LOGM(LOG, "disableHead on {}", PMONITOR->szName); PMONITOR->activeMonitorRule.disabled = true; + if (!g_pConfigManager->replaceMonitorRule(PMONITOR->activeMonitorRule)) + g_pConfigManager->appendMonitorRule(PMONITOR->activeMonitorRule); g_pHyprRenderer->applyMonitorRule(PMONITOR, &PMONITOR->activeMonitorRule, false); }); @@ -356,6 +361,7 @@ bool COutputConfiguration::applyTestConfiguration(bool test) { SMonitorRule newRule = PMONITOR->activeMonitorRule; newRule.name = PMONITOR->szName; + newRule.disabled = false; if (head->committedProperties & COutputConfigurationHead::eCommittedProperties::OUTPUT_HEAD_COMMITTED_MODE) { newRule.resolution = {head->state.mode->getMode()->width, head->state.mode->getMode()->height}; @@ -380,7 +386,8 @@ bool COutputConfiguration::applyTestConfiguration(bool test) { // reset properties for next set. head->committedProperties = 0; - g_pConfigManager->appendMonitorRule(newRule); + if (!g_pConfigManager->replaceMonitorRule(newRule)) + g_pConfigManager->appendMonitorRule(newRule); g_pConfigManager->m_bWantsMonitorReload = true; } |
