mirror of
https://github.com/hyprwm/Hyprland.git
synced 2026-09-24 15:19:30 -05:00
protocols/activation: send an invalid token when serial isn't valid (#11505)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "XDGActivation.hpp"
|
||||
#include "../managers/TokenManager.hpp"
|
||||
#include "../Compositor.hpp"
|
||||
#include "../managers/SeatManager.hpp"
|
||||
#include "core/Compositor.hpp"
|
||||
#include <algorithm>
|
||||
|
||||
@@ -23,6 +24,12 @@ CXDGActivationToken::CXDGActivationToken(SP<CXdgActivationTokenV1> resource_) :
|
||||
return;
|
||||
}
|
||||
|
||||
if (!g_pSeatManager->serialValid(g_pSeatManager->seatResourceForClient(m_resource->client()), m_serial)) {
|
||||
LOGM(LOG, "serial not found, sending invalid token");
|
||||
m_resource->sendDone("__invalid__");
|
||||
return;
|
||||
}
|
||||
|
||||
m_committed = true;
|
||||
// send done with a new token
|
||||
m_token = g_pTokenManager->registerNewToken({}, std::chrono::months{12});
|
||||
|
||||
Reference in New Issue
Block a user