mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 01:29:50 +01:00
compositor: simplify getWindowFromSurface
This commit is contained in:
parent
2da3cfb422
commit
99088eaed8
1 changed files with 3 additions and 8 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue