Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
IdleInhibitor.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 <QWindow>
10
11#include <memory>
12
13namespace PhosphorWayland {
14
26class PHOSPHORWAYLAND_EXPORT IdleInhibitor : public QObject
27{
28 Q_OBJECT
29 Q_PROPERTY(QWindow* surface READ surface WRITE setSurface NOTIFY surfaceChanged)
30 Q_PROPERTY(bool active READ isActive NOTIFY activeChanged)
31
32public:
33 explicit IdleInhibitor(QObject* parent = nullptr);
34 ~IdleInhibitor() override;
35
36 [[nodiscard]] QWindow* surface() const;
37 void setSurface(QWindow* window);
38
39 [[nodiscard]] bool isActive() const;
40
41 static bool isSupported();
42
43Q_SIGNALS:
46
47private:
48 void createInhibitor();
49 void destroyInhibitor();
50
51 class Private;
52 std::unique_ptr<Private> d;
53};
54
55} // namespace PhosphorWayland
Prevents the compositor from idling the output that the associated surface is visible on.
Definition IdleInhibitor.h:27
void setSurface(QWindow *window)
IdleInhibitor(QObject *parent=nullptr)
Definition CompositorLost.h:11