mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-07-26 01:31:54 -07:00
Implement ext-session-lock-v1
This commit is contained in:
46
src/managers/SessionLockManager.hpp
Normal file
46
src/managers/SessionLockManager.hpp
Normal file
@@ -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;
|
Reference in New Issue
Block a user