window: ignore surface updates in unsafe / on invalid monitors

This commit is contained in:
Vaxry 2024-03-05 20:46:08 +00:00
parent 31e1287da2
commit 05dd204c5f

View file

@ -336,7 +336,7 @@ void sendLeaveIter(wlr_surface* pSurface, int x, int y, void* data) {
}
void CWindow::updateSurfaceScaleTransformDetails() {
if (!m_bIsMapped || m_bHidden)
if (!m_bIsMapped || m_bHidden || g_pCompositor->m_bUnsafeState)
return;
const auto PLASTMONITOR = g_pCompositor->getMonitorFromID(m_iLastSurfaceMonitorID);
@ -345,6 +345,9 @@ void CWindow::updateSurfaceScaleTransformDetails() {
const auto PNEWMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID);
if (!PNEWMONITOR)
return;
if (PNEWMONITOR != PLASTMONITOR) {
if (PLASTMONITOR && PLASTMONITOR->m_bEnabled)
wlr_surface_for_each_surface(m_pWLSurface.wlr(), sendLeaveIter, PLASTMONITOR->output);