KWindowSystem

kwaylandextras.h
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2021 Aleix Pol <aleixpol@kde.org>
4 SPDX-FileCopyrightText: 2023 Nicolas Fella <nicolas.fella@gmx.de>
5
6 SPDX-License-Identifier: LGPL-2.1-or-later
7*/
8
9#ifndef KWAYLANDEXTRAS_H
10#define KWAYLANDEXTRAS_H
11
12#include <QObject>
13#include <QWindow>
14
15#include <kwindowsystem_export.h>
16
17/**
18 * A collection of functions to do Wayland things
19 * @since 6.0
20 */
21class KWINDOWSYSTEM_EXPORT KWaylandExtras : public QObject
22{
23 Q_OBJECT
24
25public:
26 static KWaylandExtras *self();
27
28 /**
29 * Requests an xdg_activation_v1 token for a specific window.
30 *
31 * @param win window in behalf this request is made
32 * @param serial of the event that triggered the request
33 * @param app_id identifier of the application that we are launching
34 *
35 * @see lastInputSerial
36 */
37 Q_INVOKABLE static void requestXdgActivationToken(QWindow *win, uint32_t serial, const QString &app_id);
38
39 /**
40 * Offers the seat's current serial
41 */
42 Q_INVOKABLE static quint32 lastInputSerial(QWindow *window);
43
44 /**
45 * Requests to export the given window using xdg_foreign_v2.
46 *
47 * @param window The window to export.
48 *
49 * @see windowExported
50 * @since 6.0
51 */
52 Q_INVOKABLE static void exportWindow(QWindow *window);
53
54 /**
55 * Unexport the window previously exported using xdg_foreign_v2.
56 *
57 * Asks the compositor to revoke the handle.
58 *
59 * @param window The window to unexport.
60 * @since 6.0
61 */
62 Q_INVOKABLE static void unexportWindow(QWindow *window);
63
65 /**
66 * Activation @p token to pass to the client.
67 *
68 * @see requestXdgActivationToken
69 */
70 void xdgActivationTokenArrived(int serial, const QString &token);
71
72 /**
73 * Window @p handle to pass to the client.
74 *
75 * @param window The window that requested the handle.
76 * @param handle The handle.
77 *
78 * @see exportWindow
79 * @since 6.0
80 */
81 void windowExported(QWindow *window, const QString &handle);
82
83private:
86
87 void *d;
88};
89
90#endif
A collection of functions to do Wayland things.
void xdgActivationTokenArrived(int serial, const QString &token)
Activation token to pass to the client.
void windowExported(QWindow *window, const QString &handle)
Window handle to pass to the client.
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:10:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.