mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 10:45:58 +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) {
|
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) {
|
||||||
|
|
Loading…
Reference in a new issue