monitor: fix DS deactivation (#13188)

This commit is contained in:
UjinT34 2026-02-04 15:42:43 +03:00 committed by GitHub
parent 1bc857b12c
commit 02ff413002
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -177,6 +177,7 @@ class CMonitor {
// for direct scanout
PHLWINDOWREF m_lastScanout;
bool m_directScanoutIsActive = false; // for cleanup logic. m_lastScanout.expired() can become true before the DS cleanup if client crashes/exits while DS is active.
bool m_scanoutNeedsCursorUpdate = false;
// for special fade/blur

View file

@ -1315,10 +1315,12 @@ void CHyprRenderer::renderMonitor(PHLMONITOR pMonitor, bool commit) {
bool shouldTear = pMonitor->updateTearing();
if (pMonitor->attemptDirectScanout()) {
pMonitor->m_directScanoutIsActive = true;
return;
} else if (!pMonitor->m_lastScanout.expired()) {
} else if (!pMonitor->m_lastScanout.expired() || pMonitor->m_directScanoutIsActive) {
Log::logger->log(Log::DEBUG, "Left a direct scanout.");
pMonitor->m_lastScanout.reset();
pMonitor->m_directScanoutIsActive = false;
// reset DRM format, but only if needed since it might modeset
if (pMonitor->m_output->state->state().drmFormat != pMonitor->m_prevDrmFormat)