Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwaylandxdgactivationv1.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5#include <QtWaylandClient/private/qwaylanddisplay_p.h>
6#include <QtWaylandClient/private/qwaylandinputdevice_p.h>
7
9
10namespace QtWaylandClient {
11
12QWaylandXdgActivationV1::QWaylandXdgActivationV1(wl_registry *registry, uint32_t id,
13 uint32_t availableVersion)
14 : QtWayland::xdg_activation_v1(registry, id, qMin(availableVersion, 1u))
15{
16}
17
19{
20 Q_ASSERT(isInitialized());
21 destroy();
22}
23
26 struct ::wl_surface *surface,
27 std::optional<uint32_t> serial,
28 const QString &app_id)
29{
30 auto wl = get_activation_token();
31 auto provider = new QWaylandXdgActivationTokenV1;
32 provider->init(wl);
33
34 if (surface)
35 provider->set_surface(surface);
36
37 if (!app_id.isEmpty())
38 provider->set_app_id(app_id);
39
40 if (serial && display->lastInputDevice())
41 provider->set_serial(*serial, display->lastInputDevice()->wl_seat());
42 provider->commit();
43 return provider;
44}
45
50}
51
53
54#include "moc_qwaylandxdgactivationv1_p.cpp"
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QWaylandXdgActivationV1(struct ::wl_registry *registry, uint32_t id, uint32_t availableVersion)
QWaylandXdgActivationTokenV1 * requestXdgActivationToken(QWaylandDisplay *display, struct ::wl_surface *surface, std::optional< uint32_t > serial, const QString &app_id)
struct wl_display * display
Definition linuxdmabuf.h:41
Combined button and popup list for selecting options.
constexpr const T & qMin(const T &a, const T &b)
Definition qminmax.h:40
GLenum GLuint id
[7]
#define Q_ASSERT(cond)
Definition qrandom.cpp:47