Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
LockSurface.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#include <QPointer>
10#include <QScreen>
11#include <QWindow>
12
13namespace PhosphorWayland {
14
17inline constexpr const char* IsSessionLock = "_ps_session_lock";
18inline constexpr const char* Surface = "_ps_session_lock_surface";
19} // namespace LockSurfaceProps
20
40class PHOSPHORWAYLAND_EXPORT LockSurface : public QObject
41{
42 Q_OBJECT
43 Q_DISABLE_COPY_MOVE(LockSurface)
44
45 Q_PROPERTY(QScreen* screen READ screen WRITE setScreen NOTIFY screenChanged)
46 Q_PROPERTY(bool configured READ isConfigured NOTIFY configuredChanged)
47
48public:
49 ~LockSurface() override;
50
54 void setScreen(QScreen* screen);
55 [[nodiscard]] QScreen* screen() const;
56
59 [[nodiscard]] bool isConfigured() const;
60
64 static LockSurface* get(QWindow* window);
65
67 static LockSurface* find(QWindow* window);
68
70 static bool isSupported();
71
72Q_SIGNALS:
75
76private:
77 friend class SessionLockWindow;
78 explicit LockSurface(QWindow* window);
79 void setConfigured(bool configured);
80
81 QPointer<QWindow> m_window;
82 QPointer<QScreen> m_screen;
83 bool m_configured = false;
84};
85
86} // namespace PhosphorWayland
87
88Q_DECLARE_METATYPE(PhosphorWayland::LockSurface*)
Marks a QWindow as an ext_session_lock_surface_v1 for one output.
Definition LockSurface.h:41
friend class SessionLockWindow
Definition LockSurface.h:77
static LockSurface * get(QWindow *window)
Get or create the LockSurface for window.
void setScreen(QScreen *screen)
The output this lock surface covers.
static bool isSupported()
True iff the compositor advertises ext_session_lock_manager_v1.
static LockSurface * find(QWindow *window)
The existing LockSurface for window, or nullptr.
QScreen * screen() const
bool isConfigured() const
True once the compositor has sized the surface and the window has taken that size.
Property keys used by LockSurface ↔ QPA plugin communication.
Definition LockSurface.h:16
constexpr const char * IsSessionLock
Definition LockSurface.h:17
constexpr const char * Surface
Definition LockSurface.h:18
Definition BackgroundEffect.h:15