summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornyx <nnyyxxxx@protonmail.com>2025-02-17 13:02:32 -0500
committerGitHub <noreply@github.com>2025-02-17 19:02:32 +0100
commitd01f9943e1d401b09fc53be3c161279ab4f2c5ba (patch)
tree99657baf4bc0551aa9ae926c6ca3a027247aa646 /src
parent59c615c321c45302491de3b1c003844c86aefca7 (diff)
subsurfaces: dont try to access popup surfaces when handling subsurface updates (#9421)
Diffstat (limited to 'src')
-rw-r--r--src/desktop/Popup.cpp7
-rw-r--r--src/desktop/Popup.hpp1
-rw-r--r--src/desktop/Subsurface.cpp4
3 files changed, 10 insertions, 2 deletions
diff --git a/src/desktop/Popup.cpp b/src/desktop/Popup.cpp
index 82767ead..912069e7 100644
--- a/src/desktop/Popup.cpp
+++ b/src/desktop/Popup.cpp
@@ -282,6 +282,9 @@ void CPopup::recheckTree() {
}
void CPopup::recheckChildrenRecursive() {
+ if (m_bInert || !m_pWLSurface)
+ return;
+
std::vector<WP<CPopup>> cpy;
std::ranges::for_each(m_vChildren, [&cpy](const auto& el) { cpy.emplace_back(el); });
for (auto const& c : cpy) {
@@ -367,3 +370,7 @@ WP<CPopup> CPopup::at(const Vector2D& globalCoords, bool allowsInput) {
return {};
}
+
+bool CPopup::inert() const {
+ return m_bInert;
+}
diff --git a/src/desktop/Popup.hpp b/src/desktop/Popup.hpp
index 0bca436c..f6ca65da 100644
--- a/src/desktop/Popup.hpp
+++ b/src/desktop/Popup.hpp
@@ -34,6 +34,7 @@ class CPopup {
void recheckTree();
bool visible();
+ bool inert() const;
// will also loop over this node
void breadthfirst(std::function<void(WP<CPopup>, void*)> fn, void* data);
diff --git a/src/desktop/Subsurface.cpp b/src/desktop/Subsurface.cpp
index db106a09..9846764c 100644
--- a/src/desktop/Subsurface.cpp
+++ b/src/desktop/Subsurface.cpp
@@ -107,7 +107,7 @@ void CSubsurface::onCommit() {
g_pHyprRenderer->damageSurface(m_pWLSurface->resource(), COORDS.x, COORDS.y);
- if (m_pPopupParent)
+ if (m_pPopupParent && !m_pPopupParent->inert() && m_pPopupParent->m_pWLSurface)
m_pPopupParent->recheckTree();
if (!m_pWindowParent.expired()) // I hate you firefox why are you doing this
m_pWindowParent->m_pPopupHead->recheckTree();
@@ -124,7 +124,7 @@ void CSubsurface::onCommit() {
// g_pHyprRenderer->damageBox(box);
CBox box;
- if (m_pPopupParent)
+ if (m_pPopupParent && !m_pPopupParent->inert() && m_pPopupParent->m_pWLSurface)
box = m_pPopupParent->m_pWLSurface->getSurfaceBoxGlobal().value_or(CBox{});
else if (m_pWindowParent)
box = m_pWindowParent->getWindowMainSurfaceBox();