From 9518cec833606166f6901fae0e68503a64938fce Mon Sep 17 00:00:00 2001 From: Vaxry Date: Fri, 17 May 2024 19:43:56 +0100 Subject: [PATCH] popup: clip input region to surface size fixes #6125 --- src/desktop/Popup.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/desktop/Popup.cpp b/src/desktop/Popup.cpp index c652d2983..03acfff91 100644 --- a/src/desktop/Popup.cpp +++ b/src/desktop/Popup.cpp @@ -301,7 +301,9 @@ CPopup* CPopup::at(const Vector2D& globalCoords, bool allowsInput) { return p; } else { const Vector2D offset = p->m_pResource ? (p->size() - p->m_pResource->geometry.size()) / 2.F : Vector2D{}; - const auto REGION = CRegion{&p->m_sWLSurface.wlr()->current.input}.translate(p->coordsGlobal() + offset); + const auto REGION = CRegion{&p->m_sWLSurface.wlr()->current.input} + .intersect(CBox{{}, {p->m_sWLSurface.wlr()->current.width, p->m_sWLSurface.wlr()->current.height}}) + .translate(p->coordsGlobal() + offset); if (REGION.containsPoint(globalCoords)) return p; }