| 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 "qwaylandinputdevice_p.h" |
| 7 | |
| 8 | QT_BEGIN_NAMESPACE |
| 9 | |
| 10 | namespace QtWaylandClient { |
| 11 | |
| 12 | QWaylandShellSurface::QWaylandShellSurface(QWaylandWindow *window) |
| 13 | : m_window(window) |
| 14 | { |
| 15 | } |
| 16 | |
| 17 | void QWaylandShellSurface::setWindowFlags(Qt::WindowFlags flags) |
| 18 | { |
| 19 | Q_UNUSED(flags); |
| 20 | } |
| 21 | |
| 22 | void QWaylandShellSurface::sendProperty(const QString &name, const QVariant &value) |
| 23 | { |
| 24 | Q_UNUSED(name); |
| 25 | Q_UNUSED(value); |
| 26 | } |
| 27 | |
| 28 | QPlatformWindow *QWaylandShellSurface::platformWindow() |
| 29 | { |
| 30 | return m_window; |
| 31 | } |
| 32 | |
| 33 | wl_surface *QWaylandShellSurface::wlSurface() |
| 34 | { |
| 35 | return m_window ? m_window->wlSurface() : nullptr; |
| 36 | } |
| 37 | |
| 38 | void QWaylandShellSurface::setWindowGeometry(const QRect &rect) |
| 39 | { |
| 40 | setWindowPosition(rect.topLeft()); |
| 41 | setWindowSize(rect.size()); |
| 42 | } |
| 43 | |
| 44 | void QWaylandShellSurface::resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset) |
| 45 | { |
| 46 | m_window->resizeFromApplyConfigure(sizeWithMargins, offset); |
| 47 | } |
| 48 | |
| 49 | void QWaylandShellSurface::repositionFromApplyConfigure(const QPoint &position) |
| 50 | { |
| 51 | m_window->repositionFromApplyConfigure(position); |
| 52 | } |
| 53 | |
| 54 | void QWaylandShellSurface::setGeometryFromApplyConfigure(const QPoint &globalPosition, const QSize &sizeWithMargins) |
| 55 | { |
| 56 | m_window->setGeometryFromApplyConfigure(globalPosition, sizeWithMargins); |
| 57 | } |
| 58 | |
| 59 | void QWaylandShellSurface::applyConfigureWhenPossible() |
| 60 | { |
| 61 | m_window->applyConfigureWhenPossible(); |
| 62 | } |
| 63 | |
| 64 | void QWaylandShellSurface::handleActivationChanged(bool activated) |
| 65 | { |
| 66 | if (activated) |
| 67 | m_window->display()->handleWindowActivated(window: m_window); |
| 68 | else |
| 69 | m_window->display()->handleWindowDeactivated(window: m_window); |
| 70 | } |
| 71 | |
| 72 | uint32_t QWaylandShellSurface::getSerial(QWaylandInputDevice *inputDevice) |
| 73 | { |
| 74 | return inputDevice->serial(); |
| 75 | } |
| 76 | |
| 77 | void QWaylandShellSurface::setXdgActivationToken(const QString &token) |
| 78 | { |
| 79 | Q_UNUSED(token); |
| 80 | qCWarning(lcQpaWayland) << "setXdgActivationToken not implemented"<< token; |
| 81 | } |
| 82 | |
| 83 | void QWaylandShellSurface::requestXdgActivationToken(quint32 serial) |
| 84 | { |
| 85 | Q_UNUSED(serial); |
| 86 | Q_EMIT m_window->xdgActivationTokenCreated({}); |
| 87 | } |
| 88 | |
| 89 | /*! |
| 90 | Determines whether the client should commit the surface with no buffer |
| 91 | after creating the role and performing initial setup |
| 92 | */ |
| 93 | bool QWaylandShellSurface::commitSurfaceRole() const |
| 94 | { |
| 95 | return true; |
| 96 | } |
| 97 | |
| 98 | } |
| 99 | |
| 100 | QT_END_NAMESPACE |
| 101 | |
| 102 | #include "moc_qwaylandshellsurface_p.cpp" |
| 103 |
