#pragma once #include "../defines.hpp" #include "../helpers/Timer.hpp" #include "../helpers/signal/Signal.hpp" #include #include class CSessionLockSurface; class CSessionLock; class CWLSurfaceResource; struct SSessionLockSurface { SSessionLockSurface(SP surface_); WP surface; WP pWlrSurface; uint64_t iMonitorID = -1; bool mapped = false; struct { CHyprSignalListener map; CHyprSignalListener destroy; CHyprSignalListener commit; } listeners; }; struct SSessionLock { WP lock; std::vector> vSessionLockSurfaces; std::unordered_map mMonitorsWithoutMappedSurfaceTimers; struct { CHyprSignalListener newSurface; CHyprSignalListener unlock; CHyprSignalListener destroy; } listeners; }; class CSessionLockManager { public: CSessionLockManager(); ~CSessionLockManager() = default; SSessionLockSurface* getSessionLockSurfaceForMonitor(uint64_t); float getRedScreenAlphaForMonitor(uint64_t); bool isSessionLocked(); bool isSessionLockPresent(); bool isSurfaceSessionLock(SP); void removeSessionLockSurface(SSessionLockSurface*); private: UP m_pSessionLock; struct { CHyprSignalListener newLock; } listeners; void onNewSessionLock(SP pWlrLock); }; inline std::unique_ptr g_pSessionLockManager;