aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-09-24 17:12:15 +0100
committervaxerski <[email protected]>2023-09-24 17:12:15 +0100
commitf5149524e8232571d7929c9ac7708c10a8b51cc9 (patch)
tree6fc82aa602a6f1b22fa87669d2ea7e50c9217663
parent649a37f9b9683018b4e57a4e617e14d5ced3c7e0 (diff)
downloadHyprland-f5149524e8232571d7929c9ac7708c10a8b51cc9.tar.gz
Hyprland-f5149524e8232571d7929c9ac7708c10a8b51cc9.zip
move unsafe checks to frame
-rw-r--r--src/config/ConfigManager.cpp3
-rw-r--r--src/events/Monitors.cpp6
2 files changed, 5 insertions, 4 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index eb5edde1..8c83824f 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -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);
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)
}