From 129e99a6f60eac7ece31a1ccd1e781075fd53050 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 3 Feb 2023 11:58:55 +0000 Subject: Implement ext-session-lock-v1 --- src/managers/SessionLockManager.hpp | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/managers/SessionLockManager.hpp (limited to 'src/managers/SessionLockManager.hpp') 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> 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 g_pSessionLockManager; \ No newline at end of file -- cgit v1.2.3