From 5dd224805deb437f6fa83359ee66a4d0f52262d2 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Thu, 11 Dec 2025 16:29:26 +0000 Subject: desktop/view: use aliveAndVisible for most things (#12631) --- src/desktop/view/View.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/desktop/view/View.cpp') diff --git a/src/desktop/view/View.cpp b/src/desktop/view/View.cpp index e7c6ce3a..17a10c64 100644 --- a/src/desktop/view/View.cpp +++ b/src/desktop/view/View.cpp @@ -1,4 +1,5 @@ #include "View.hpp" +#include "../../protocols/core/Compositor.hpp" using namespace Desktop; using namespace Desktop::View; @@ -14,3 +15,14 @@ IView::IView(SP pWlSurface) : m_wlSurface(pWlSurface) SP IView::resource() const { return m_wlSurface ? m_wlSurface->resource() : nullptr; } + +bool IView::aliveAndVisible() const { + auto res = resource(); + if (!res) + return false; + + if (!res->m_mapped) + return false; + + return visible(); +} -- cgit v1.2.3