Skip to content

Commit

Permalink
subsurfaces: dont try to access popup surfaces when handling subsurfa…
Browse files Browse the repository at this point in the history
…ce updates (#9421)
  • Loading branch information
nnyyxxxx authored Feb 17, 2025
1 parent 59c615c commit d01f994
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/desktop/Popup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -367,3 +370,7 @@ WP<CPopup> CPopup::at(const Vector2D& globalCoords, bool allowsInput) {

return {};
}

bool CPopup::inert() const {
return m_bInert;
}
1 change: 1 addition & 0 deletions src/desktop/Popup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/desktop/Subsurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit d01f994

Please sign in to comment.