2020-11-07 02:03:57 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "kwin_export.h"
|
|
|
|
#include <QObject>
|
2022-05-05 00:19:24 +00:00
|
|
|
#include <QPointer>
|
2020-11-07 02:03:57 +00:00
|
|
|
|
2023-09-13 17:59:29 +00:00
|
|
|
namespace KWin
|
2020-11-07 02:03:57 +00:00
|
|
|
{
|
2023-09-13 17:59:29 +00:00
|
|
|
|
2020-11-07 02:03:57 +00:00
|
|
|
class SeatInterface;
|
|
|
|
class ClientConnection;
|
|
|
|
class SurfaceInterface;
|
|
|
|
class XdgActivationV1Interface;
|
2021-07-15 16:35:04 +00:00
|
|
|
class PlasmaWindowActivationInterface;
|
2020-11-07 02:03:57 +00:00
|
|
|
|
|
|
|
class KWIN_EXPORT XdgActivationV1Integration : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2023-09-13 17:59:29 +00:00
|
|
|
XdgActivationV1Integration(XdgActivationV1Interface *activation, QObject *parent);
|
2020-11-07 02:03:57 +00:00
|
|
|
|
2023-09-13 17:59:29 +00:00
|
|
|
QString requestPrivilegedToken(SurfaceInterface *surface, uint serial, SeatInterface *seat, const QString &appId)
|
2022-05-20 14:03:23 +00:00
|
|
|
{
|
|
|
|
return requestToken(true, surface, serial, seat, appId);
|
|
|
|
}
|
2023-09-13 17:59:29 +00:00
|
|
|
void activateSurface(SurfaceInterface *surface, const QString &token);
|
2020-11-07 02:03:57 +00:00
|
|
|
|
|
|
|
private:
|
2023-09-13 17:59:29 +00:00
|
|
|
QString requestToken(bool isPrivileged, SurfaceInterface *surface, uint serial, SeatInterface *seat, const QString &appId);
|
2020-11-07 02:03:57 +00:00
|
|
|
void clear();
|
|
|
|
|
2022-05-17 10:36:34 +00:00
|
|
|
struct ActivationToken
|
|
|
|
{
|
2023-08-10 16:53:37 +00:00
|
|
|
QString token;
|
|
|
|
bool isPrivileged;
|
2023-09-13 17:59:29 +00:00
|
|
|
QPointer<const SurfaceInterface> surface;
|
2023-08-10 16:53:37 +00:00
|
|
|
uint serial;
|
2023-09-13 17:59:29 +00:00
|
|
|
SeatInterface *seat;
|
2023-08-10 16:53:37 +00:00
|
|
|
QString applicationId;
|
|
|
|
bool showNotify;
|
2023-09-13 17:59:29 +00:00
|
|
|
std::unique_ptr<PlasmaWindowActivationInterface> activation;
|
2022-05-17 10:36:34 +00:00
|
|
|
};
|
|
|
|
std::unique_ptr<ActivationToken> m_currentActivationToken;
|
2020-11-07 02:03:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|