1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #include "qwaylandsubsurface_p.h" |
5 | |
6 | #include "qwaylandwindow_p.h" |
7 | |
8 | #include <QtCore/QDebug> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | namespace QtWaylandClient { |
13 | |
14 | QWaylandSubSurface::QWaylandSubSurface(QWaylandWindow *window, QWaylandWindow *parent, ::wl_subsurface *sub_surface) |
15 | : QtWayland::wl_subsurface(sub_surface) |
16 | , m_window(window) |
17 | , m_parent(parent) |
18 | { |
19 | m_parent->mChildren << this; |
20 | setDeSync(); |
21 | } |
22 | |
23 | QWaylandSubSurface::~QWaylandSubSurface() |
24 | { |
25 | m_parent->mChildren.removeOne(t: this); |
26 | destroy(); |
27 | } |
28 | |
29 | void QWaylandSubSurface::setSync() |
30 | { |
31 | QMutexLocker l(&m_syncLock); |
32 | QWaylandSubSurface::set_sync(); |
33 | } |
34 | |
35 | void QWaylandSubSurface::setDeSync() |
36 | { |
37 | QMutexLocker l(&m_syncLock); |
38 | QWaylandSubSurface::set_desync(); |
39 | } |
40 | |
41 | void QWaylandSubSurface::set_sync() |
42 | { |
43 | m_synchronized = true; |
44 | QtWayland::wl_subsurface::set_sync(); |
45 | } |
46 | |
47 | void QWaylandSubSurface::set_desync() |
48 | { |
49 | m_synchronized = false; |
50 | QtWayland::wl_subsurface::set_desync(); |
51 | } |
52 | |
53 | } |
54 | |
55 | QT_END_NAMESPACE |
56 |