summaryrefslogtreecommitdiff
path: root/src/managers/SessionLockManager.hpp
diff options
context:
space:
mode:
authorJunxuan Liao <70618504+MikeWalrus@users.noreply.github.com>2024-07-13 18:32:08 +0800
committerGitHub <noreply@github.com>2024-07-13 12:32:08 +0200
commit7486576fa7a3d394254cb07734679df4b2469071 (patch)
tree6f62e6c73cfec489ca2e068f0018fb0a1ad62da5 /src/managers/SessionLockManager.hpp
parentf85c6416c6f5e56c75178ecb24c11e346069197d (diff)
session-lock: send `locked` after the lock screen is properly rendered (#6850)
The protocol says: > The locked event "must not be sent until a new "locked" frame (either from a > session lock surface or the compositor blanking the output) has been presented > on all outputs and no security sensitive normal/unlocked content is possibly > visible". This helps users ensure the screen is properly locked before suspending the machine. (e.g. with swaylock --ready-fd)
Diffstat (limited to 'src/managers/SessionLockManager.hpp')
-rw-r--r--src/managers/SessionLockManager.hpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/managers/SessionLockManager.hpp b/src/managers/SessionLockManager.hpp
index fe4a4434..b01ee288 100644
--- a/src/managers/SessionLockManager.hpp
+++ b/src/managers/SessionLockManager.hpp
@@ -5,6 +5,7 @@
#include "../helpers/signal/Signal.hpp"
#include <cstdint>
#include <unordered_map>
+#include <unordered_set>
class CSessionLockSurface;
class CSessionLock;
@@ -37,6 +38,9 @@ struct SSessionLock {
CHyprSignalListener unlock;
CHyprSignalListener destroy;
} listeners;
+
+ bool m_hasSentLocked = false;
+ std::unordered_set<uint64_t> m_lockedMonitors;
};
class CSessionLockManager {
@@ -54,6 +58,8 @@ class CSessionLockManager {
void removeSessionLockSurface(SSessionLockSurface*);
+ void onLockscreenRenderedOnMonitor(uint64_t id);
+
private:
UP<SSessionLock> m_pSessionLock;
@@ -64,4 +70,4 @@ class CSessionLockManager {
void onNewSessionLock(SP<CSessionLock> pWlrLock);
};
-inline std::unique_ptr<CSessionLockManager> g_pSessionLockManager; \ No newline at end of file
+inline std::unique_ptr<CSessionLockManager> g_pSessionLockManager;