From 99088eaed806d9268967baf09bc09cdb987c5357 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Wed, 24 Jul 2024 11:07:22 +0200 Subject: [PATCH] compositor: simplify getWindowFromSurface --- src/Compositor.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 24098bee..7caaa98a 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1184,15 +1184,10 @@ SP CCompositor::vectorToLayerSurface(const Vector2D& pos, st } PHLWINDOW CCompositor::getWindowFromSurface(SP pSurface) { - for (auto& w : m_vWindows) { - if (!w->m_bIsMapped || w->m_bFadingOut) - continue; + if (!pSurface || !pSurface->hlSurface) + return nullptr; - if (w->m_pWLSurface->resource() == pSurface) - return w; - } - - return nullptr; + return pSurface->hlSurface->getWindow(); } PHLWINDOW CCompositor::getWindowFromHandle(uint32_t handle) {