mirror of
https://github.com/hyprwm/Hyprland
synced 2025-12-27 14:30:06 +01:00
protocols/activation: send an invalid token when serial isn't valid (#11505)
This commit is contained in:
parent
0d45b277d6
commit
d9cf1cb78e
1 changed files with 7 additions and 0 deletions
|
|
@ -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});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue