From bb933dcf04ff1daafbc9681c87b87d7e907ae7bd Mon Sep 17 00:00:00 2001 From: Vaxry Date: Fri, 15 Mar 2024 15:55:24 +0000 Subject: [PATCH] popup: avoid damage loops with commits fixes #5118 --- src/desktop/Popup.cpp | 7 ++++--- src/desktop/Popup.hpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/desktop/Popup.cpp b/src/desktop/Popup.cpp index d5599c65..98d5881a 100644 --- a/src/desktop/Popup.cpp +++ b/src/desktop/Popup.cpp @@ -133,7 +133,7 @@ void CPopup::onUnmap() { g_pInputManager->simulateMouseMovement(); } -void CPopup::onCommit() { +void CPopup::onCommit(bool ignoreSiblings) { if (m_pWLR->base->initial_commit) { wlr_xdg_surface_schedule_configure(m_pWLR->base); return; @@ -152,7 +152,8 @@ void CPopup::onCommit() { m_vLastPos = COORDSLOCAL; } - m_pSubsurfaceHead->recheckDamageForSubsurfaces(); + if (!ignoreSiblings) + m_pSubsurfaceHead->recheckDamageForSubsurfaces(); g_pHyprRenderer->damageSurface(m_sWLSurface.wlr(), COORDS.x, COORDS.y); @@ -227,7 +228,7 @@ void CPopup::recheckTree() { void CPopup::recheckChildrenRecursive() { for (auto& c : m_vChildren) { - c->onCommit(); + c->onCommit(true); c->recheckChildrenRecursive(); } } diff --git a/src/desktop/Popup.hpp b/src/desktop/Popup.hpp index 0ac460d1..5f7af085 100644 --- a/src/desktop/Popup.hpp +++ b/src/desktop/Popup.hpp @@ -26,7 +26,7 @@ class CPopup { void onDestroy(); void onMap(); void onUnmap(); - void onCommit(); + void onCommit(bool ignoreSiblings = false); void onReposition(); void recheckTree();