From 0b215c5f246d3fde6c023e78b3e3579f7498c172 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 4 May 2024 23:46:10 +0100 Subject: idle-inhibit: fix and cleanup visibility logic fixes #5878 --- src/desktop/WLSurface.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/desktop/WLSurface.cpp') 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 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. +} -- cgit v1.2.3