aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2022-12-08 17:43:15 +0000
committervaxerski <[email protected]>2022-12-08 17:43:15 +0000
commitcba10ba5b7c9a027d0fe111a7035d74a4a938750 (patch)
tree3ede6115e4fcf2ce17f9a3667c70c1413f6008b1
parent050693be2ed63d377c7d275810df947dd1a7d7ee (diff)
downloadHyprland-cba10ba5b7c9a027d0fe111a7035d74a4a938750.tar.gz
Hyprland-cba10ba5b7c9a027d0fe111a7035d74a4a938750.zip
fix memory safety in getWindowFromSurface
-rw-r--r--src/Compositor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 942479e0..c0fec3ad 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -911,6 +911,9 @@ wlr_surface* CCompositor::vectorToLayerSurface(const Vector2D& pos, std::vector<
CWindow* CCompositor::getWindowFromSurface(wlr_surface* pSurface) {
for (auto& w : m_vWindows) {
+ if (!w->m_bIsMapped || w->m_bFadingOut || !w->m_bMappedX11)
+ continue;
+
if (g_pXWaylandManager->getWindowSurface(w.get()) == pSurface)
return w.get();
}