compositor: simplify getWindowFromSurface

This commit is contained in:
Vaxry 2024-07-24 11:07:22 +02:00
parent 2da3cfb422
commit 99088eaed8

View file

@ -1184,15 +1184,10 @@ SP<CWLSurfaceResource> CCompositor::vectorToLayerSurface(const Vector2D& pos, st
} }
PHLWINDOW CCompositor::getWindowFromSurface(SP<CWLSurfaceResource> pSurface) { PHLWINDOW CCompositor::getWindowFromSurface(SP<CWLSurfaceResource> pSurface) {
for (auto& w : m_vWindows) { if (!pSurface || !pSurface->hlSurface)
if (!w->m_bIsMapped || w->m_bFadingOut) return nullptr;
continue;
if (w->m_pWLSurface->resource() == pSurface) return pSurface->hlSurface->getWindow();
return w;
}
return nullptr;
} }
PHLWINDOW CCompositor::getWindowFromHandle(uint32_t handle) { PHLWINDOW CCompositor::getWindowFromHandle(uint32_t handle) {