move unsafe checks to frame

This commit is contained in:
vaxerski 2023-09-24 17:12:15 +01:00
parent 649a37f9b9
commit f5149524e8
2 changed files with 5 additions and 4 deletions

View File

@ -2020,9 +2020,6 @@ void CConfigManager::performMonitorReload() {
if (overAgain)
performMonitorReload();
if (!g_pCompositor->m_vMonitors.empty()) // reset unsafe state if we have monitors
g_pCompositor->leaveUnsafeState();
m_bWantsMonitorReload = false;
EMIT_HOOK_EVENT("monitorLayoutChanged", nullptr);

View File

@ -112,7 +112,6 @@ void Events::listener_newOutput(wl_listener* listener, void* data) {
}
g_pCompositor->m_bReadyToProcess = true;
g_pCompositor->leaveUnsafeState();
}
g_pConfigManager->m_bWantsMonitorReload = true;
@ -139,6 +138,11 @@ void Events::listener_monitorFrame(void* owner, void* data) {
if ((g_pCompositor->m_sWLRSession && !g_pCompositor->m_sWLRSession->active) || !g_pCompositor->m_bSessionActive || g_pCompositor->m_bUnsafeState) {
Debug::log(WARN, "Attempted to render frame on inactive session!");
if (g_pCompositor->m_bUnsafeState && PMONITOR->output != g_pCompositor->m_pUnsafeOutput) {
// restore from unsafe state
g_pCompositor->leaveUnsafeState();
}
return; // cannot draw on session inactive (different tty)
}