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) {
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) {