kwin/src/xdgactivationv1.h
Aleix Pol f3ec05c85a wayland: Fix activation when activating surfaces disappear
We track when the user last interacted with a window so that we can
decide on the relevance of newly activated windows.

Fixes network/neochat#524
2022-05-09 00:59:27 +02:00

54 lines
1.3 KiB
C++

/*
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>
#include <QSharedPointer>
namespace KWaylandServer
{
class SeatInterface;
class ClientConnection;
class SurfaceInterface;
class XdgActivationV1Interface;
class PlasmaWindowActivationInterface;
}
namespace KWin
{
class KWIN_EXPORT XdgActivationV1Integration : public QObject
{
Q_OBJECT
public:
XdgActivationV1Integration(KWaylandServer::XdgActivationV1Interface *activation, QObject *parent);
struct ActivationToken
{
~ActivationToken();
const QString token;
const KWaylandServer::ClientConnection *client;
QPointer<const KWaylandServer::SurfaceInterface> surface;
const uint serial;
const KWaylandServer::SeatInterface *seat;
QString applicationId;
QSharedPointer<KWaylandServer::PlasmaWindowActivationInterface> activation;
};
void activateSurface(KWaylandServer::SurfaceInterface *surface, const QString &token);
private:
void clear();
QScopedPointer<ActivationToken> m_currentActivationToken;
};
}