aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2024-07-24 11:07:22 +0200
committerVaxry <[email protected]>2024-07-24 11:07:28 +0200
commit99088eaed806d9268967baf09bc09cdb987c5357 (patch)
treee63e2921dccee9dd474995ae0f9247f389ad349d
parent2da3cfb4220af818b8b44fcc52c9b9b54cbe155e (diff)
downloadHyprland-99088eaed806d9268967baf09bc09cdb987c5357.tar.gz
Hyprland-99088eaed806d9268967baf09bc09cdb987c5357.zip
compositor: simplify getWindowFromSurface
-rw-r--r--src/Compositor.cpp11
1 files 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<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 (w->m_pWLSurface->resource() == pSurface)
- return w;
- }
+ if (!pSurface || !pSurface->hlSurface)
+ return nullptr;
- return nullptr;
+ return pSurface->hlSurface->getWindow();
}
PHLWINDOW CCompositor::getWindowFromHandle(uint32_t handle) {