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 "qwaylandshellsurface_p.h"
5#include "qwaylandwindow_p.h"
6#include "qwaylandextendedsurface_p.h"
7#include "qwaylandinputdevice_p.h"
8
9QT_BEGIN_NAMESPACE
10
11namespace QtWaylandClient {
12
13QWaylandShellSurface::QWaylandShellSurface(QWaylandWindow *window)
14 : m_window(window)
15{
16}
17
18void QWaylandShellSurface::setWindowFlags(Qt::WindowFlags flags)
19{
20 Q_UNUSED(flags);
21}
22
23void QWaylandShellSurface::sendProperty(const QString &name, const QVariant &value)
24{
25 Q_UNUSED(name);
26 Q_UNUSED(value);
27}
28
29QPlatformWindow *QWaylandShellSurface::platformWindow()
30{
31 return m_window;
32}
33
34wl_surface *QWaylandShellSurface::wlSurface()
35{
36 return m_window ? m_window->wlSurface() : nullptr;
37}
38
39void QWaylandShellSurface::resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset)
40{
41 m_window->resizeFromApplyConfigure(sizeWithMargins, offset);
42}
43
44void QWaylandShellSurface::repositionFromApplyConfigure(const QPoint &position)
45{
46 m_window->repositionFromApplyConfigure(position);
47}
48
49void QWaylandShellSurface::setGeometryFromApplyConfigure(const QPoint &globalPosition, const QSize &sizeWithMargins)
50{
51 m_window->setGeometryFromApplyConfigure(globalPosition, sizeWithMargins);
52}
53
54void QWaylandShellSurface::applyConfigureWhenPossible()
55{
56 m_window->applyConfigureWhenPossible();
57}
58
59void QWaylandShellSurface::handleActivationChanged(bool activated)
60{
61 if (activated)
62 m_window->display()->handleWindowActivated(window: m_window);
63 else
64 m_window->display()->handleWindowDeactivated(window: m_window);
65}
66
67uint32_t QWaylandShellSurface::getSerial(QWaylandInputDevice *inputDevice)
68{
69 return inputDevice->serial();
70}
71
72void QWaylandShellSurface::setXdgActivationToken(const QString &token)
73{
74 Q_UNUSED(token);
75 qCWarning(lcQpaWayland) << "setXdgActivationToken not implemented" << token;
76}
77
78void QWaylandShellSurface::requestXdgActivationToken(quint32 serial)
79{
80 Q_UNUSED(serial);
81 Q_EMIT m_window->xdgActivationTokenCreated({});
82}
83}
84
85QT_END_NAMESPACE
86
87#include "moc_qwaylandshellsurface_p.cpp"
88

source code of qtwayland/src/client/qwaylandshellsurface.cpp