Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
LockSurfaceWindow.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 <QQuickWindow>
7#include <QtQml/qqmlregistration.h>
8
9QT_BEGIN_NAMESPACE
10class QScreen;
11class QShowEvent;
12QT_END_NAMESPACE
13
14namespace PhosphorWayland {
15class LockSurface;
16}
17
18namespace PhosphorShellLock {
19
47class LockSurfaceWindow : public QQuickWindow
48{
49 Q_OBJECT
50 QML_NAMED_ELEMENT(LockSurface)
51 Q_PROPERTY(QScreen* screen READ screen WRITE setScreen NOTIFY screenChanged)
52 Q_PROPERTY(bool configured READ isConfigured NOTIFY configuredChanged)
53
54public:
55 explicit LockSurfaceWindow(QWindow* parent = nullptr);
57
60 [[nodiscard]] QScreen* screen() const;
61 void setScreen(QScreen* screen);
62
64 [[nodiscard]] bool isConfigured() const;
65
68 Q_INVOKABLE [[nodiscard]] bool canExist() const;
69
70Q_SIGNALS:
74 void refused();
75
76protected:
77 void showEvent(QShowEvent* event) override;
78
79private:
80 PhosphorWayland::LockSurface* m_surface = nullptr;
81};
82
83} // namespace PhosphorShellLock
LockSurfaceWindow(QWindow *parent=nullptr)
bool isConfigured() const
True once the compositor has sized the surface.
QScreen * screen() const
The output this surface covers.
void refused()
A show was refused because no session lock is held; the window hides itself right after.
void showEvent(QShowEvent *event) override
bool canExist() const
Whether a show right now would be honoured: a session lock is held or in flight.
Marks a QWindow as an ext_session_lock_surface_v1 for one output.
Definition LockSurface.h:41
Definition LockKeyboard.h:14
Definition BackgroundEffect.h:15