kwin/src/xdgactivationv1.h

56 lines
1.4 KiB
C
Raw Normal View History

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>
#include <QPointer>
2020-11-07 02:03:57 +00:00
namespace KWin
2020-11-07 02:03:57 +00:00
{
2020-11-07 02:03:57 +00:00
class SeatInterface;
class ClientConnection;
class SurfaceInterface;
class XdgActivationV1Interface;
class PlasmaWindowActivationInterface;
2020-11-07 02:03:57 +00:00
class KWIN_EXPORT XdgActivationV1Integration : public QObject
{
Q_OBJECT
public:
XdgActivationV1Integration(XdgActivationV1Interface *activation, QObject *parent);
2020-11-07 02:03:57 +00:00
QString requestPrivilegedToken(SurfaceInterface *surface, uint serial, SeatInterface *seat, const QString &appId)
{
return requestToken(true, surface, serial, seat, appId);
}
void activateSurface(SurfaceInterface *surface, const QString &token);
2020-11-07 02:03:57 +00:00
private:
QString requestToken(bool isPrivileged, SurfaceInterface *surface, uint serial, SeatInterface *seat, const QString &appId);
2020-11-07 02:03:57 +00:00
void clear();
struct ActivationToken
{
QString token;
bool isPrivileged;
QPointer<const SurfaceInterface> surface;
uint serial;
SeatInterface *seat;
QString applicationId;
bool showNotify;
std::unique_ptr<PlasmaWindowActivationInterface> activation;
};
std::unique_ptr<ActivationToken> m_currentActivationToken;
2020-11-07 02:03:57 +00:00
};
}