summaryrefslogtreecommitdiff
path: root/src/desktop/Subsurface.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-05-04 23:46:10 +0100
committerVaxry <vaxry@vaxry.net>2024-05-04 23:46:10 +0100
commit0b215c5f246d3fde6c023e78b3e3579f7498c172 (patch)
treeb4449e42b8deb0efc259b463307e2f1e69335dc0 /src/desktop/Subsurface.cpp
parenta3309b51a254f142c535022615be6f76eb23fa9b (diff)
idle-inhibit: fix and cleanup visibility logic
fixes #5878
Diffstat (limited to 'src/desktop/Subsurface.cpp')
-rw-r--r--src/desktop/Subsurface.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/desktop/Subsurface.cpp b/src/desktop/Subsurface.cpp
index b2c9f8bd..1809efe5 100644
--- a/src/desktop/Subsurface.cpp
+++ b/src/desktop/Subsurface.cpp
@@ -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;
+}