summaryrefslogtreecommitdiff
path: root/src/protocols/SessionLock.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-05-07 18:42:55 +0100
committerVaxry <vaxry@vaxry.net>2024-05-07 18:43:00 +0100
commit22a86fd7a287e16522bef80d4a89f399ce654cc3 (patch)
tree35b23b3ca45eb6259e015538ff313ad8f223c4a0 /src/protocols/SessionLock.cpp
parent598bbd186b1e6e70a01ba7f98c89404531008f15 (diff)
session-lock: don't allow events from rejected locks
fixes #5913
Diffstat (limited to 'src/protocols/SessionLock.cpp')
-rw-r--r--src/protocols/SessionLock.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/protocols/SessionLock.cpp b/src/protocols/SessionLock.cpp
index 19582be4..db3404be 100644
--- a/src/protocols/SessionLock.cpp
+++ b/src/protocols/SessionLock.cpp
@@ -113,6 +113,11 @@ CSessionLock::CSessionLock(SP<CExtSessionLockV1> resource_) : resource(resource_
});
resource->setUnlockAndDestroy([this](CExtSessionLockV1* r) {
+ if (inert) {
+ PROTO::sessionLock->destroyResource(this);
+ return;
+ }
+
events.unlockAndDestroy.emit();
inert = true;
PROTO::sessionLock->locked = false;
@@ -132,6 +137,11 @@ bool CSessionLock::good() {
return resource->resource();
}
+void CSessionLock::sendDenied() {
+ inert = true;
+ resource->sendFinished();
+}
+
CSessionLockProtocol::CSessionLockProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
;
}
@@ -171,8 +181,8 @@ void CSessionLockProtocol::onLock(CExtSessionLockManagerV1* pMgr, uint32_t id) {
if (m_vLocks.size() > 1) {
LOGM(ERR, "Tried to lock a locked session");
- RESOURCE->resource->sendFinished();
RESOURCE->inert = true;
+ RESOURCE->resource->sendFinished();
return;
}