output-layout: fix wlroots display handling (#3718)

This commit is contained in:
Alessio Molinari
2023-11-12 14:14:05 +01:00
committed by GitHub
parent 91cbe93cf8
commit 1bfd4a2bff
5 changed files with 22 additions and 10 deletions

View File

@@ -188,7 +188,7 @@ void CMonitor::onConnect(bool noRule) {
g_pCompositor->scheduleFrameForMonitor(this);
}
void CMonitor::onDisconnect() {
void CMonitor::onDisconnect(bool destroy) {
if (renderTimer) {
wl_event_source_remove(renderTimer);
@@ -276,7 +276,8 @@ void CMonitor::onDisconnect() {
activeWorkspace = -1;
wlr_output_layout_remove(g_pCompositor->m_sWLROutputLayout, output);
if (!destroy)
wlr_output_layout_remove(g_pCompositor->m_sWLROutputLayout, output);
wlr_output_enable(output, false);
@@ -298,7 +299,6 @@ void CMonitor::onDisconnect() {
g_pHyprRenderer->m_pMostHzMonitor = pMonitorMostHz;
}
std::erase_if(g_pCompositor->m_vMonitors, [&](std::shared_ptr<CMonitor>& el) { return el.get() == this; });
}
@@ -642,4 +642,4 @@ void CMonitor::moveTo(const Vector2D& pos) {
Vector2D CMonitor::middle() {
return vecPosition + vecSize / 2.f;
}
}