feat(slock): implement ext_session_lock_v1 backend

note: did not run lints or fully test yet
This commit is contained in:
outfoxxed 2024-02-28 04:37:52 -08:00
parent 70c5cf1e16
commit 1fa87b7c5a
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
12 changed files with 525 additions and 1 deletions

View file

@ -0,0 +1,38 @@
#pragma once
#include <qobject.h>
#include <qtclasshelpermacros.h>
#include <qwayland-ext-session-lock-v1.h>
class QSWaylandSessionLockManager;
class QSWaylandSessionLock
: public QObject
, public QtWayland::ext_session_lock_v1 {
Q_OBJECT;
public:
QSWaylandSessionLock(QSWaylandSessionLockManager* manager, ::ext_session_lock_v1* lock);
~QSWaylandSessionLock() override;
Q_DISABLE_COPY_MOVE(QSWaylandSessionLock);
void unlock();
// Returns true if the lock has not finished.
[[nodiscard]] bool active() const;
// Returns true if the compositor considers the session to be locked.
[[nodiscard]] bool hasCompositorLock() const;
signals:
void compositorLocked();
void unlocked();
private:
void ext_session_lock_v1_locked() override;
void ext_session_lock_v1_finished() override;
QSWaylandSessionLockManager* manager; // static and not dealloc'd
// true when the compositor determines the session is locked
bool locked = false;
};