Commit da8ad320 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

xdg_activation_v1: Improve internal API

Be explicit about how we only request privileged tokens internally in
KWin.
parent 13dd31d9
Pipeline #178946 passed with stage
in 24 minutes and 44 seconds
......@@ -324,7 +324,7 @@ void WindowSystem::requestToken(QWindow *win, uint32_t serial, const QString &ap
Q_UNUSED(win); // it's coming from within kwin, it doesn't matter the window
auto seat = KWin::waylandServer()->seat();
auto token = KWin::waylandServer()->xdgActivationIntegration()->requestToken(true, nullptr, seat->display()->serial(), seat, appId);
auto token = KWin::waylandServer()->xdgActivationIntegration()->requestPrivilegedToken(nullptr, seat->display()->serial(), seat, appId);
// Ensure that xdgActivationTokenArrived is always emitted asynchronously
QTimer::singleShot(0, [serial, token] {
Q_EMIT KWindowSystem::self()->xdgActivationTokenArrived(serial, token);
......
......@@ -44,10 +44,14 @@ public:
QSharedPointer<KWaylandServer::PlasmaWindowActivationInterface> activation;
};
QString requestToken(bool isPrivileged, KWaylandServer::SurfaceInterface *surface, uint serial, KWaylandServer::SeatInterface *seat, const QString &appId);
QString requestPrivilegedToken(KWaylandServer::SurfaceInterface *surface, uint serial, KWaylandServer::SeatInterface *seat, const QString &appId)
{
return requestToken(true, surface, serial, seat, appId);
}
void activateSurface(KWaylandServer::SurfaceInterface *surface, const QString &token);
private:
QString requestToken(bool isPrivileged, KWaylandServer::SurfaceInterface *surface, uint serial, KWaylandServer::SeatInterface *seat, const QString &appId);
void clear();
QScopedPointer<ActivationToken> m_currentActivationToken;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment