mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-07-26 01:31:54 -07:00
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)
This commit is contained in:
@@ -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;
|
||||
inline std::unique_ptr<CSessionLockManager> g_pSessionLockManager;
|
||||
|
Reference in New Issue
Block a user