diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index 4ea34156..7497957a 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -1155,7 +1155,8 @@ int CWindow::getRealBorderSize() { } bool CWindow::canBeTorn() { - return m_sWindowData.tearing.valueOr(m_bTearingHint); + static auto PTEARING = CConfigValue("general:allow_tearing"); + return m_sWindowData.tearing.valueOr(m_bTearingHint) && *PTEARING; } bool CWindow::shouldSendFullscreenState() { diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp index 4217e279..bfa2a20e 100644 --- a/src/events/Monitors.cpp +++ b/src/events/Monitors.cpp @@ -26,19 +26,18 @@ void Events::listener_monitorFrame(void* owner, void* data) { CMonitor* const PMONITOR = (CMonitor*)owner; - // FIXME: - // 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_pAqBackend->hasSession() && !g_pCompositor->m_pAqBackend->session->active) || !g_pCompositor->m_bSessionActive || g_pCompositor->m_bUnsafeState) { + Debug::log(WARN, "Attempted to render frame on inactive session!"); - // if (g_pCompositor->m_bUnsafeState && std::ranges::any_of(g_pCompositor->m_vMonitors.begin(), g_pCompositor->m_vMonitors.end(), [&](auto& m) { - // return m->output != g_pCompositor->m_pUnsafeOutput->output; - // })) { - // // restore from unsafe state - // g_pCompositor->leaveUnsafeState(); - // } + if (g_pCompositor->m_bUnsafeState && std::ranges::any_of(g_pCompositor->m_vMonitors.begin(), g_pCompositor->m_vMonitors.end(), [&](auto& m) { + return m->output != g_pCompositor->m_pUnsafeOutput->output; + })) { + // restore from unsafe state + g_pCompositor->leaveUnsafeState(); + } - // return; // cannot draw on session inactive (different tty) - // } + return; // cannot draw on session inactive (different tty) + } if (!PMONITOR->m_bEnabled) return;