Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
SessionLock.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include <phosphorwayland_export.h>
7
8#include <QObject>
9
10#include <memory>
11
12namespace PhosphorWayland {
13
41class PHOSPHORWAYLAND_EXPORT SessionLock : public QObject
42{
43 Q_OBJECT
44 Q_DISABLE_COPY_MOVE(SessionLock)
45 Q_PROPERTY(bool locked READ isLocked NOTIFY lockedChanged)
46
47public:
48 explicit SessionLock(QObject* parent = nullptr);
49 ~SessionLock() override;
50
53 static bool isSupported();
54
59 void lock();
60
68
71 [[nodiscard]] bool isLocked() const;
72
73Q_SIGNALS:
76 void locked();
77
81 void finished();
82
85
86private:
87 class Private;
88 std::unique_ptr<Private> d;
89};
90
91} // namespace PhosphorWayland
Client-side wrapper around ext_session_lock_manager_v1 / ext_session_lock_v1.
Definition SessionLock.h:42
bool isLocked() const
True between locked() and unlockAndDestroy() (or a compositor-driven finished()).
void unlockAndDestroy()
Release the lock after a successful authentication: sends unlock_and_destroy and flushes.
void locked()
The session is now locked; this client owns the lock and must call unlockAndDestroy() to release it.
SessionLock(QObject *parent=nullptr)
void lockedChanged()
isLocked() changed.
void finished()
The compositor will not (or will no longer) lock the session: the lock object has been torn down and ...
static bool isSupported()
True iff the compositor advertises ext_session_lock_manager_v1.
void lock()
Request that the session be locked.
Definition ClipboardDevice.h:15