summaryrefslogtreecommitdiff
path: root/src/desktop/view/View.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-12-11 16:29:26 +0000
committerGitHub <noreply@github.com>2025-12-11 16:29:26 +0000
commit5dd224805deb437f6fa83359ee66a4d0f52262d2 (patch)
tree9a5b2466a9cbbeaa03c8e3876fe103e18aad8794 /src/desktop/view/View.cpp
parent2ca7ad7efc1e20588af5c823ee46f23afad6cf91 (diff)
desktop/view: use aliveAndVisible for most things (#12631)
Diffstat (limited to 'src/desktop/view/View.cpp')
-rw-r--r--src/desktop/view/View.cpp12
1 files changed, 12 insertions, 0 deletions
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<Desktop::View::CWLSurface> pWlSurface) : m_wlSurface(pWlSurface)
SP<CWLSurfaceResource> 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();
+}