From d0b3cdc835f8170feee8a18a64178496a852d6ae Mon Sep 17 00:00:00 2001 From: vaxerski Date: Wed, 9 Nov 2022 10:56:36 +0000 Subject: [PATCH] Fix crashes with DS and mirrors --- src/render/Renderer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index f90b729b..aed7d212 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -565,9 +565,12 @@ void countSubsurfacesIter(wlr_surface* pSurface, int x, int y, void* data) { } bool CHyprRenderer::attemptDirectScanout(CMonitor* pMonitor) { + if (!pMonitor->mirrors.empty()) + return false; // do not DS if this monitor is being mirrored. Will break the functionality. + const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pMonitor->activeWorkspace); - if (!PWORKSPACE->m_bHasFullscreenWindow || g_pInputManager->m_sDrag.drag || g_pCompositor->m_sSeat.exclusiveClient) + if (!PWORKSPACE || !PWORKSPACE->m_bHasFullscreenWindow || g_pInputManager->m_sDrag.drag || g_pCompositor->m_sSeat.exclusiveClient) return false; const auto PCANDIDATE = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID);