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 Phosphor::Screens {
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;
65
70 bool m_queryPending = false;
71 bool m_requeryQueued = false;
74 bool m_queuedEmitRequeryCompleted = false;
75
77 QHash<QString, Offsets> m_offsets;
78
80 QTimer m_requeryTimer;
81
85 QDBusServiceWatcher* m_plasmaShellWatcher = nullptr;
86
89 QDBusPendingCallWatcher* m_activeWatcher = nullptr;
90};
91
92} // namespace Phosphor::Screens
Pluggable producer of panel-reservation offsets per screen.
Definition IPanelSource.h:33
IPanelSource implementation that queries KDE Plasma Shell over D-Bus for panel-reservation offsets.
Definition PlasmaPanelSource.h:42
bool ready() const override
Has any successful query landed? Drives ScreenManager's panelGeometryReady one-shot signal — consumer...
void requestRequery(int delayMs=0) override
Best-effort: ask the backend to re-query immediately, optionally after a short delay (e....
void start() override
Begin watching.
Offsets currentOffsets(QScreen *screen) const override
Snapshot for a given screen.
void stop() override
Stop watching.
PlasmaPanelSource(QObject *parent=nullptr)
Definition IWindowTrackingService.h:26
Per-edge reserved geometry, in physical pixels relative to the screen's top-left.
Definition IPanelSource.h:40