summaryrefslogtreecommitdiff
path: root/src/managers/SessionLockManager.hpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-02-03 11:58:55 +0000
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-02-03 11:58:55 +0000
commit129e99a6f60eac7ece31a1ccd1e781075fd53050 (patch)
tree013b31817af992a52d733369a7227a237e8c0d26 /src/managers/SessionLockManager.hpp
parent32d56fec977b109aeecb06288a1b45cfe6b83117 (diff)
Implement ext-session-lock-v1
Diffstat (limited to 'src/managers/SessionLockManager.hpp')
-rw-r--r--src/managers/SessionLockManager.hpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/managers/SessionLockManager.hpp b/src/managers/SessionLockManager.hpp
new file mode 100644
index 00000000..51232867
--- /dev/null
+++ b/src/managers/SessionLockManager.hpp
@@ -0,0 +1,46 @@
+#pragma once
+
+#include "../defines.hpp"
+
+struct SSessionLockSurface {
+ wlr_session_lock_surface_v1* pWlrLockSurface = nullptr;
+ int iMonitorID = -1;
+
+ bool mapped = false;
+
+ DYNLISTENER(map);
+ DYNLISTENER(destroy);
+ DYNLISTENER(commit);
+};
+
+struct SSessionLock {
+ bool active = false;
+ wlr_session_lock_v1* pWlrLock = nullptr;
+
+ std::vector<std::unique_ptr<SSessionLockSurface>> vSessionLockSurfaces;
+
+ DYNLISTENER(newSurface);
+ DYNLISTENER(unlock);
+ DYNLISTENER(destroy);
+};
+
+class CSessionLockManager {
+ public:
+ CSessionLockManager() = default;
+ ~CSessionLockManager() = default;
+
+ void onNewSessionLock(wlr_session_lock_v1*);
+ SSessionLockSurface* getSessionLockSurfaceForMonitor(const int&);
+
+ bool isSessionLocked();
+ bool isSurfaceSessionLock(wlr_surface*);
+
+ void removeSessionLockSurface(SSessionLockSurface*);
+
+ void activateLock();
+
+ private:
+ SSessionLock m_sSessionLock;
+};
+
+inline std::unique_ptr<CSessionLockManager> g_pSessionLockManager; \ No newline at end of file