xdg_activation_v1: Improve internal API

Be explicit about how we only request privileged tokens internally in
KWin.
remotes/origin/work/fhek/overview_effect_allow_navigation_between_virtual_desktops
Aleix Pol 4 years ago committed by Aleix Pol Gonzalez
parent 13dd31d98a
commit da8ad3201b
  1. 2
      src/plugins/windowsystem/windowsystem.cpp
  2. 6
      src/xdgactivationv1.h

@ -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;

Loading…
Cancel
Save