fix memory safety in getWindowFromSurface

This commit is contained in:
vaxerski 2022-12-08 17:43:15 +00:00
parent 050693be2e
commit cba10ba5b7
1 changed files with 3 additions and 0 deletions

View File

@ -911,6 +911,9 @@ wlr_surface* CCompositor::vectorToLayerSurface(const Vector2D& pos, std::vector<
CWindow* CCompositor::getWindowFromSurface(wlr_surface* pSurface) {
for (auto& w : m_vWindows) {
if (!w->m_bIsMapped || w->m_bFadingOut || !w->m_bMappedX11)
continue;
if (g_pXWaylandManager->getWindowSurface(w.get()) == pSurface)
return w.get();
}