summaryrefslogtreecommitdiff
path: root/src/desktop/view/View.cpp
blob: 17a10c64b220078ee0c57b857f4f44fee1cec22b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "View.hpp"
#include "../../protocols/core/Compositor.hpp"

using namespace Desktop;
using namespace Desktop::View;

SP<Desktop::View::CWLSurface> IView::wlSurface() const {
    return m_wlSurface;
}

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();
}