Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
Phosphor::Screens::NoOpPanelSource Class Referencefinal

Trivial IPanelSource that reports zero offsets and ready=true. More...

#include <phosphor-screens/include/PhosphorScreens/NoOpPanelSource.h>

Inheritance diagram for Phosphor::Screens::NoOpPanelSource:
[legend]

Public Member Functions

 NoOpPanelSource (QObject *parent=nullptr)
 
void start () override
 Begin watching.
 
void stop () override
 Stop watching.
 
Offsets currentOffsets (QScreen *) 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.
 

Detailed Description

Trivial IPanelSource that reports zero offsets and ready=true.

Use on hosts where panels don't reserve geometry (Wayfire, Sway, COSMIC with manual layout) or in unit tests. ScreenManager treats ready()=true as "no point waiting on panel geometry, the screen rect is the rect" so panelGeometryReady fires on the first start() and downstream layout starts immediately instead of stalling.

Header-only and inline — no compiled object code.

Constructor & Destructor Documentation

◆ NoOpPanelSource()

Phosphor::Screens::NoOpPanelSource::NoOpPanelSource ( QObject *  parent = nullptr)
inlineexplicit

Member Function Documentation

◆ currentOffsets()

Offsets Phosphor::Screens::NoOpPanelSource::currentOffsets ( QScreen *  screen) const
inlineoverridevirtual

Snapshot for a given screen.

Returns zero offsets if the source has no information for this screen yet.

Implements Phosphor::Screens::IPanelSource.

◆ ready()

bool Phosphor::Screens::NoOpPanelSource::ready ( ) const
inlineoverridevirtual

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.

◆ requestRequery()

void Phosphor::Screens::NoOpPanelSource::requestRequery ( int  delayMs = 0)
inlineoverridevirtual

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.

◆ start()

void Phosphor::Screens::NoOpPanelSource::start ( )
inlineoverridevirtual

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.

◆ stop()

void Phosphor::Screens::NoOpPanelSource::stop ( )
inlineoverridevirtual

Stop watching.

Subsequent currentOffsets queries should still return the last-known values; only the change channel is closed.

Implements Phosphor::Screens::IPanelSource.


The documentation for this class was generated from the following file: