IPanelSource implementation that queries KDE Plasma Shell over D-Bus for panel-reservation offsets. More...
#include <phosphor-screens/include/PhosphorScreens/PlasmaPanelSource.h>
Public Member Functions | |
| PlasmaPanelSource (QObject *parent=nullptr) | |
| ~PlasmaPanelSource () override | |
| void | start () override |
| Begin watching. | |
| void | stop () override |
| Stop watching. | |
| Offsets | currentOffsets (QScreen *screen) const override |
| Snapshot for a given screen. | |
| bool | ready () const override |
Has any successful query landed? Drives ScreenManager's panelGeometryReady one-shot signal — consumers that compute initial zone geometry at daemon startup gate on this so they don't lay out windows against the unreserved screen rect. | |
| void | requestRequery (int delayMs=0) override |
| Best-effort: ask the backend to re-query immediately, optionally after a short delay (e.g. | |
Public Member Functions inherited from Phosphor::Screens::IPanelSource | |
| IPanelSource (QObject *parent=nullptr) | |
| ~IPanelSource () override=default | |
Additional Inherited Members | |
Signals inherited from Phosphor::Screens::IPanelSource | |
| void | panelOffsetsChanged (QScreen *screen) |
Offsets for screen changed. | |
| void | requeryCompleted () |
A requestRequery cycle completed. | |
IPanelSource implementation that queries KDE Plasma Shell over D-Bus for panel-reservation offsets.
Pure D-Bus client — links Qt6::DBus only, no KF6, no KDE Frameworks. Built into PhosphorScreens unconditionally; consumers on non-KDE desktops just wire a different IPanelSource (typically NoOpPanelSource).
Lifecycle:
org.kde.plasmashell registration. Kicks off an initial async query immediately if the service is already on the bus, otherwise waits for the registration signal.QScreen::name() (the connector name). Plasma's panel API exposes a screen INDEX which can disagree with Qt's screen list ordering on multi-monitor setups, so we match by screen geometry instead.Coalescing: rapid requestRequery calls coalesce into a single in-flight D-Bus call. The watcher slot fires requeryCompleted exactly once per outstanding request after the reply lands.
|
explicit |
|
override |
|
overridevirtual |
Snapshot for a given screen.
Returns zero offsets if the source has no information for this screen yet.
Implements Phosphor::Screens::IPanelSource.
|
overridevirtual |
Has any successful query landed? Drives ScreenManager's panelGeometryReady one-shot signal — consumers that compute initial zone geometry at daemon startup gate on this so they don't lay out windows against the unreserved screen rect.
Latch semantics: implementations MAY keep ready() returning true across stop / start cycles — the contract is "panels
have been queried successfully at least once", not "a fresh query
has completed since the last start". Consumers that need a liveness indicator should listen for requeryCompleted after their own requestRequery, rather than polling ready().
Implements Phosphor::Screens::IPanelSource.
|
overridevirtual |
Best-effort: ask the backend to re-query immediately, optionally after a short delay (e.g.
to let a panel-editor UI close fully before settling). Implementations that don't support push-style refresh can no-op; requeryCompleted is still expected to fire at most once per call so callers can chain UI updates.
Implements Phosphor::Screens::IPanelSource.
|
overridevirtual |
Begin watching.
Implementations may emit panelOffsetsChanged any time after this returns; ScreenManager reads currentOffsets on each emission to refresh its cache.
Implements Phosphor::Screens::IPanelSource.
|
overridevirtual |
Stop watching.
Subsequent currentOffsets queries should still return the last-known values; only the change channel is closed.
Implements Phosphor::Screens::IPanelSource.