From fb91c2550f5184785680f6af7b069cb857568104 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 17 Nov 2024 16:16:49 +0000 Subject: [PATCH] renderer: don't render unmapped popups fixes #8485 --- src/desktop/Popup.hpp | 4 ++-- src/render/Renderer.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/desktop/Popup.hpp b/src/desktop/Popup.hpp index f34b8a2c..e9b3e0f0 100644 --- a/src/desktop/Popup.hpp +++ b/src/desktop/Popup.hpp @@ -41,6 +41,7 @@ class CPopup { // SP m_pWLSurface; + bool m_bMapped = false; private: // T1 owners, each popup has to have one of these @@ -57,8 +58,7 @@ class CPopup { bool m_bRequestedReposition = false; - bool m_bInert = false; - bool m_bMapped = false; + bool m_bInert = false; // std::vector> m_vChildren; diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index 3eba8458..6067a7f2 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -732,7 +732,7 @@ void CHyprRenderer::renderWindow(PHLWINDOW pWindow, PHLMONITOR pMonitor, timespe pWindow->m_pPopupHead->breadthfirst( [](CPopup* popup, void* data) { - if (!popup->m_pWLSurface || !popup->m_pWLSurface->resource()) + if (!popup->m_pWLSurface || !popup->m_pWLSurface->resource() || !popup->m_bMapped) return; auto pos = popup->coordsRelativeToParent(); auto rd = (SRenderData*)data; @@ -822,7 +822,7 @@ void CHyprRenderer::renderLayer(PHLLS pLayer, PHLMONITOR pMonitor, timespec* tim if (popups) { pLayer->popupHead->breadthfirst( [](CPopup* popup, void* data) { - if (!popup->m_pWLSurface || !popup->m_pWLSurface->resource()) + if (!popup->m_pWLSurface || !popup->m_pWLSurface->resource() || !popup->m_bMapped) return; Vector2D pos = popup->coordsRelativeToParent();