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
45class PHOSPHORWAYLAND_EXPORT SessionLock : public QObject
46{
47 Q_OBJECT
48 Q_DISABLE_COPY_MOVE(SessionLock)
49 Q_PROPERTY(bool locked READ isLocked NOTIFY lockedChanged)
50
51public:
52 explicit SessionLock(QObject* parent = nullptr);
53 ~SessionLock() override;
54
58 static bool isSupported();
59
70 void lock();
71
79
82 [[nodiscard]] bool isLocked() const;
83
87 static bool canCreateSurfaces();
88
89Q_SIGNALS:
92 void locked();
93
97 void finished();
98
101
102private:
103 class Private;
104 std::unique_ptr<Private> d;
105};
106
107} // namespace PhosphorWayland
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.
static bool canCreateSurfaces()
True while a lock object exists (requested or granted), which is when a LockSurface-marked window can...
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 BackgroundEffect.h:15