aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/events/Monitors.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/events/Monitors.cpp')
-rw-r--r--src/events/Monitors.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp
index 9d17fd34..947f9e7f 100644
--- a/src/events/Monitors.cpp
+++ b/src/events/Monitors.cpp
@@ -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)
}