Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwaylandqtshellintegration.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
6
7#include <QtWaylandCompositor/QWaylandCompositor>
8#include <QtWaylandCompositor/QWaylandQuickShellSurfaceItem>
9#include <QtWaylandCompositor/QWaylandSeat>
11
13
14namespace QtWayland {
15
16QtShellIntegration::QtShellIntegration(QWaylandQuickShellSurfaceItem *item)
17 : QWaylandQuickShellIntegration(item)
18 , m_item(item)
19 , m_shellSurface(qobject_cast<QWaylandQtShellSurface *>(item->shellSurface()))
20{
21 m_item->setSurface(m_shellSurface->surface());
22 connect(m_shellSurface, &QWaylandQtShellSurface::destroyed,
23 this, &QtShellIntegration::handleQtShellSurfaceDestroyed);
24}
25
27{
28 // When m_shellSurface is null, handleQtShellSurfaceDestroyed() already ran, which means that the
29 // QWaylandQtShellSurface was destroyed before the wl_surface. If so, the surface is left attached
30 // to the QWaylandQuickItem, so the wl_surface destruction path can still emit surfaceDestroyed.
31 if (m_shellSurface)
32 m_item->setSurface(nullptr);
33}
34
35void QtShellIntegration::handleQtShellSurfaceDestroyed()
36{
37 m_shellSurface = nullptr;
38}
39
40}
41
42QT_END_NAMESPACE
43
44#include "moc_qwaylandqtshellintegration_p.cpp"
Combined button and popup list for selecting options.