| 1 | // Copyright (C) 2017 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #include "qwaylandivisurfaceintegration_p.h" |
| 5 | |
| 6 | #include <QtWaylandCompositor/QWaylandCompositor> |
| 7 | #include <QtWaylandCompositor/QWaylandIviSurface> |
| 8 | #include <QtWaylandCompositor/QWaylandQuickShellSurfaceItem> |
| 9 | #include <QtWaylandCompositor/QWaylandSeat> |
| 10 | |
| 11 | QT_BEGIN_NAMESPACE |
| 12 | |
| 13 | namespace QtWayland { |
| 14 | |
| 15 | IviSurfaceIntegration::IviSurfaceIntegration(QWaylandQuickShellSurfaceItem *item) |
| 16 | : QWaylandQuickShellIntegration(item) |
| 17 | , m_item(item) |
| 18 | , m_shellSurface(qobject_cast<QWaylandIviSurface *>(object: item->shellSurface())) |
| 19 | { |
| 20 | m_item->setSurface(m_shellSurface->surface()); |
| 21 | connect(sender: m_shellSurface, signal: &QWaylandIviSurface::destroyed, context: this, slot: &IviSurfaceIntegration::handleIviSurfaceDestroyed); |
| 22 | } |
| 23 | |
| 24 | IviSurfaceIntegration::~IviSurfaceIntegration() |
| 25 | { |
| 26 | m_item->setSurface(nullptr); |
| 27 | } |
| 28 | |
| 29 | void IviSurfaceIntegration::handleIviSurfaceDestroyed() |
| 30 | { |
| 31 | m_shellSurface = nullptr; |
| 32 | } |
| 33 | |
| 34 | } |
| 35 | |
| 36 | QT_END_NAMESPACE |
| 37 | |
| 38 | #include "moc_qwaylandivisurfaceintegration_p.cpp" |
| 39 |
