summaryrefslogtreecommitdiff
path: root/src/desktop/WLSurface.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/WLSurface.cpp
parenta3309b51a254f142c535022615be6f76eb23fa9b (diff)
idle-inhibit: fix and cleanup visibility logic
fixes #5878
Diffstat (limited to 'src/desktop/WLSurface.cpp')
-rw-r--r--src/desktop/WLSurface.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/desktop/WLSurface.cpp b/src/desktop/WLSurface.cpp
index 41c357e0..fd6c28b3 100644
--- a/src/desktop/WLSurface.cpp
+++ b/src/desktop/WLSurface.cpp
@@ -197,3 +197,15 @@ void CWLSurface::onCommit() {
std::shared_ptr<CPointerConstraint> CWLSurface::constraint() {
return m_pConstraint.lock();
}
+
+bool CWLSurface::visible() {
+ if (!m_pWindowOwner.expired())
+ return g_pHyprRenderer->shouldRenderWindow(m_pWindowOwner.lock());
+ if (!m_pLayerOwner.expired())
+ return true;
+ if (m_pPopupOwner)
+ return m_pPopupOwner->visible();
+ if (m_pSubsurfaceOwner)
+ return m_pSubsurfaceOwner->visible();
+ return true; // non-desktop, we don't know much.
+}