monitor: fix DS deactivation (#13188)
This commit is contained in:
parent
1bc857b12c
commit
02ff413002
2 changed files with 4 additions and 1 deletions
|
|
@ -177,6 +177,7 @@ class CMonitor {
|
||||||
|
|
||||||
// for direct scanout
|
// for direct scanout
|
||||||
PHLWINDOWREF m_lastScanout;
|
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;
|
bool m_scanoutNeedsCursorUpdate = false;
|
||||||
|
|
||||||
// for special fade/blur
|
// for special fade/blur
|
||||||
|
|
|
||||||
|
|
@ -1315,10 +1315,12 @@ void CHyprRenderer::renderMonitor(PHLMONITOR pMonitor, bool commit) {
|
||||||
bool shouldTear = pMonitor->updateTearing();
|
bool shouldTear = pMonitor->updateTearing();
|
||||||
|
|
||||||
if (pMonitor->attemptDirectScanout()) {
|
if (pMonitor->attemptDirectScanout()) {
|
||||||
|
pMonitor->m_directScanoutIsActive = true;
|
||||||
return;
|
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.");
|
Log::logger->log(Log::DEBUG, "Left a direct scanout.");
|
||||||
pMonitor->m_lastScanout.reset();
|
pMonitor->m_lastScanout.reset();
|
||||||
|
pMonitor->m_directScanoutIsActive = false;
|
||||||
|
|
||||||
// reset DRM format, but only if needed since it might modeset
|
// reset DRM format, but only if needed since it might modeset
|
||||||
if (pMonitor->m_output->state->state().drmFormat != pMonitor->m_prevDrmFormat)
|
if (pMonitor->m_output->state->state().drmFormat != pMonitor->m_prevDrmFormat)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue