Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PlasmaPanelSource.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 "IPanelSource.h"
7#include "phosphorscreens_export.h"
8
9#include <QHash>
10#include <QString>
11#include <QTimer>
12
13class QDBusPendingCallWatcher;
14class QDBusServiceWatcher;
15
16namespace PhosphorScreens {
17
41class PHOSPHORSCREENS_EXPORT PlasmaPanelSource final : public IPanelSource
42{
43 Q_OBJECT
44public:
45 explicit PlasmaPanelSource(QObject* parent = nullptr);
47
48 void start() override;
49 void stop() override;
50 Offsets currentOffsets(QScreen* screen) const override;
51 bool ready() const override;
52 void requestRequery(int delayMs = 0) override;
53
54private:
61 void issueQuery(bool emitRequeryCompleted);
62
63 bool m_running = false;
64 bool m_ready = false;
71 static constexpr int kReadyRetryCount = 3;
72 static constexpr int kReadyRetryBaseMs = 1000;
73 int m_readyRetriesRemaining = kReadyRetryCount;
74
79 bool m_queryPending = false;
80 bool m_requeryQueued = false;
83 bool m_queuedEmitRequeryCompleted = false;
84
86 QHash<QString, Offsets> m_offsets;
87
89 QTimer m_requeryTimer;
90
94 QDBusServiceWatcher* m_plasmaShellWatcher = nullptr;
95
98 QDBusPendingCallWatcher* m_activeWatcher = nullptr;
99};
100
101} // namespace PhosphorScreens
IPanelSource(QObject *parent=nullptr)
Definition IPanelSource.h:53
void requestRequery(int delayMs=0) override
Best-effort: ask the backend to re-query immediately, optionally after a short delay (e....
void stop() override
Stop watching.
bool ready() const override
Has any successful query landed?
Offsets currentOffsets(QScreen *screen) const override
Snapshot for a given screen.
PlasmaPanelSource(QObject *parent=nullptr)
void start() override
Begin watching.
Definition IWindowTrackingService.h:28
Per-edge reserved geometry, in physical pixels relative to the screen's top-left.
Definition IPanelSource.h:40