idle-inhibit: fix and cleanup visibility logic

fixes #5878
This commit is contained in:
Vaxry
2024-05-04 23:46:10 +01:00
parent a3309b51a2
commit 0b215c5f24
9 changed files with 73 additions and 27 deletions

View File

@@ -227,3 +227,14 @@ void CSubsurface::initExistingSubsurfaces(wlr_surface* pSurface) {
Vector2D CSubsurface::size() {
return {m_sWLSurface.wlr()->current.width, m_sWLSurface.wlr()->current.height};
}
bool CSubsurface::visible() {
if (!m_pWindowParent.expired())
return g_pHyprRenderer->shouldRenderWindow(m_pWindowParent.lock());
if (m_pPopupParent)
return m_pPopupParent->visible();
if (m_pParent)
return m_pParent->visible();
return false;
}