Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorEngine::IWindowTrackingService Class Referenceabstract

#include <phosphor-engine/include/PhosphorEngine/IWindowTrackingService.h>

Inheritance diagram for PhosphorEngine::IWindowTrackingService:
[legend]

Public Member Functions

virtual ~IWindowTrackingService ()=default
 
virtual QObject * asQObject ()=0
 
virtual PhosphorScreens::ScreenManagerscreenManager () const =0
 
virtual void assignWindowToZone (const QString &windowId, const QString &zoneId, const QString &screenId, int virtualDesktop)=0
 
virtual void assignWindowToZones (const QString &windowId, const QStringList &zoneIds, const QString &screenId, int virtualDesktop)=0
 
virtual void unassignWindow (const QString &windowId)=0
 
virtual QStringList recordedSnapZones (const QString &windowId) const =0
 A window's recorded snap zone(s), preferring the LIVE assignment but falling back to the DURABLE placement-record snap slot when the live cache is cold.
 
virtual QString zoneForWindow (const QString &windowId) const =0
 
virtual QStringList zonesForWindow (const QString &windowId) const =0
 
virtual QString screenForWindow (const QString &windowId) const =0
 The screen a window is assigned to (empty when none), canonicalizing the id so a window resolves across the effect-restart re-identification skew (#628).
 
virtual QString screenForWindow (const QString &windowId, const QString &defaultScreen) const =0
 Same, returning defaultScreen when the window has no assignment.
 
virtual QStringList windowsInZone (const QString &zoneId) const =0
 
virtual bool isWindowSnapped (const QString &windowId) const =0
 
virtual QString findEmptyZone (const QString &screenId=QString()) const =0
 
virtual void recordSnapIntent (const QString &windowId, bool wasUserInitiated)=0
 
virtual bool isWindowFloating (const QString &windowId) const =0
 
virtual bool isSuspensionFloat (const QString &windowId) const
 Whether the window's float is a MINIMIZE SUSPENSION rather than placement intent.
 
virtual void clearSuspensionFloat (const QString &windowId)
 Drop the suspension classification.
 
virtual void setWindowFloating (const QString &windowId, bool floating)=0
 
virtual void unsnapForFloat (const QString &windowId)=0
 
virtual bool clearFloatingForSnap (const QString &windowId)=0
 
virtual bool isWindowSticky (const QString &windowId) const =0
 
virtual QStringList preFloatZones (const QString &windowId) const =0
 
virtual QString preFloatScreen (const QString &windowId) const =0
 
virtual void clearPreFloatZone (const QString &windowId)=0
 Clear the saved pre-float zone/screen for windowId (both the windowId key and its appId alias).
 
virtual bool clearAutoSnapped (const QString &windowId)=0
 
virtual bool consumePendingAssignment (const QString &windowId)=0
 
virtual const QHash< QString, QList< PendingRestore > > & pendingRestoreQueues () const =0
 
virtual void updateLastUsedZone (const QString &zoneId, const QString &screenId, const QString &windowClass, int virtualDesktop)=0
 
virtual QString currentAppIdFor (const QString &anyWindowId) const =0
 
virtual std::optional< QRect > validatedUnmanagedGeometry (const QString &windowId, const QString &screenId, bool exactOnly=false) const =0
 The window's remembered UNMANAGED (free/float-back) geometry, resolved FOR screenId, or nullopt when no record can answer.
 
virtual void recordFreeGeometry (const QString &windowId, const QString &screenId, const QRect &geometry, bool overwrite)=0
 Record a window's SHARED free/float geometry (the single float-back store — the placement record's freeGeometryByScreen).
 
virtual void clearFreeGeometry (const QString &windowId)=0
 Clear a window's shared free/float geometry (all screens) from the record, leaving its engine slots intact.
 
virtual void releaseEngineSlot (const QString &windowId, const QString &engineId)
 Downgrade engineId's slot on windowId's record to WindowPlacement::stateReleased() and mark the placements dirty.
 
virtual void clearFreeGeometry (const QString &windowId, const QString &screenId)
 Screen-scoped consume-once variant: clears only screenId's remembered float-back, preserving other monitors' entries.
 
virtual QRect zoneGeometry (const QString &zoneId, const QString &screenId=QString()) const =0
 
virtual QRect resolveZoneGeometry (const QStringList &zoneIds, const QString &screenId) const =0
 
virtual QString resolveEffectiveScreenId (const QString &screenId) const =0
 
virtual WindowPlacementStoreplacementStore ()=0
 The unified, engine-agnostic placement store.
 
virtual QString findEmptyZoneInLayout (PhosphorZones::Layout *layout, const QString &screenId, int desktopFilter=0) const =0
 
virtual QSet< QUuid > buildOccupiedZoneSet (const QString &screenFilter=QString(), int desktopFilter=0) const =0
 
virtual QVector< ResnapEntrytakeResnapBuffer ()=0
 

Constructor & Destructor Documentation

◆ ~IWindowTrackingService()

virtual PhosphorEngine::IWindowTrackingService::~IWindowTrackingService ( )
virtualdefault

Member Function Documentation

◆ asQObject()

virtual QObject * PhosphorEngine::IWindowTrackingService::asQObject ( )
pure virtual

◆ assignWindowToZone()

virtual void PhosphorEngine::IWindowTrackingService::assignWindowToZone ( const QString &  windowId,
const QString &  zoneId,
const QString &  screenId,
int  virtualDesktop 
)
pure virtual

◆ assignWindowToZones()

virtual void PhosphorEngine::IWindowTrackingService::assignWindowToZones ( const QString &  windowId,
const QStringList &  zoneIds,
const QString &  screenId,
int  virtualDesktop 
)
pure virtual

◆ buildOccupiedZoneSet()

virtual QSet< QUuid > PhosphorEngine::IWindowTrackingService::buildOccupiedZoneSet ( const QString &  screenFilter = QString(),
int  desktopFilter = 0 
) const
pure virtual

◆ clearAutoSnapped()

virtual bool PhosphorEngine::IWindowTrackingService::clearAutoSnapped ( const QString &  windowId)
pure virtual

◆ clearFloatingForSnap()

virtual bool PhosphorEngine::IWindowTrackingService::clearFloatingForSnap ( const QString &  windowId)
pure virtual

◆ clearFreeGeometry() [1/2]

virtual void PhosphorEngine::IWindowTrackingService::clearFreeGeometry ( const QString &  windowId)
pure virtual

Clear a window's shared free/float geometry (all screens) from the record, leaving its engine slots intact.

For the drag-out / layout-change consume paths that restore the float-back once and must not re-apply it.

Implemented in PhosphorPlacement::WindowTrackingService.

◆ clearFreeGeometry() [2/2]

virtual void PhosphorEngine::IWindowTrackingService::clearFreeGeometry ( const QString &  windowId,
const QString &  screenId 
)
inlinevirtual

Screen-scoped consume-once variant: clears only screenId's remembered float-back, preserving other monitors' entries.

Default falls back to the all-screens form for implementations without per-screen granularity.

Reimplemented in PhosphorPlacement::WindowTrackingService.

◆ clearPreFloatZone()

virtual void PhosphorEngine::IWindowTrackingService::clearPreFloatZone ( const QString &  windowId)
pure virtual

Clear the saved pre-float zone/screen for windowId (both the windowId key and its appId alias).

Used to drop stale pre-float state when a floating window crosses monitors, so a later unfloat does not restore it to a zone on the monitor it left.

Implemented in PhosphorPlacement::WindowTrackingService.

◆ clearSuspensionFloat()

virtual void PhosphorEngine::IWindowTrackingService::clearSuspensionFloat ( const QString &  windowId)
inlinevirtual

Drop the suspension classification.

The adaptor owns it on the minimize/unminimize edges, but an engine-side USER unfloat (the float shortcut) also ends the suspension and never crosses that boundary — without this the bit strands and every later capture takes the minimize-preserve path. No-op for implementations that do not track the classification.

Reimplemented in PhosphorPlacement::WindowTrackingService.

◆ consumePendingAssignment()

virtual bool PhosphorEngine::IWindowTrackingService::consumePendingAssignment ( const QString &  windowId)
pure virtual

◆ currentAppIdFor()

virtual QString PhosphorEngine::IWindowTrackingService::currentAppIdFor ( const QString &  anyWindowId) const
pure virtual

◆ findEmptyZone()

virtual QString PhosphorEngine::IWindowTrackingService::findEmptyZone ( const QString &  screenId = QString()) const
pure virtual

◆ findEmptyZoneInLayout()

virtual QString PhosphorEngine::IWindowTrackingService::findEmptyZoneInLayout ( PhosphorZones::Layout layout,
const QString &  screenId,
int  desktopFilter = 0 
) const
pure virtual

◆ isSuspensionFloat()

virtual bool PhosphorEngine::IWindowTrackingService::isSuspensionFloat ( const QString &  windowId) const
inlinevirtual

Whether the window's float is a MINIMIZE SUSPENSION rather than placement intent.

Outlives the live minimize bit through the unminimize animation grace so capture paths can keep preserving the pre-minimize record. Default false for implementations that do not track the classification.

Reimplemented in PhosphorPlacement::WindowTrackingService.

◆ isWindowFloating()

virtual bool PhosphorEngine::IWindowTrackingService::isWindowFloating ( const QString &  windowId) const
pure virtual

◆ isWindowSnapped()

virtual bool PhosphorEngine::IWindowTrackingService::isWindowSnapped ( const QString &  windowId) const
pure virtual

◆ isWindowSticky()

virtual bool PhosphorEngine::IWindowTrackingService::isWindowSticky ( const QString &  windowId) const
pure virtual

◆ pendingRestoreQueues()

virtual const QHash< QString, QList< PendingRestore > > & PhosphorEngine::IWindowTrackingService::pendingRestoreQueues ( ) const
pure virtual

◆ placementStore()

virtual WindowPlacementStore & PhosphorEngine::IWindowTrackingService::placementStore ( )
pure virtual

The unified, engine-agnostic placement store.

Engines reach it through the tracking service to capture/restore the one WindowPlacement per window.

Implemented in PhosphorPlacement::WindowTrackingService.

◆ preFloatScreen()

virtual QString PhosphorEngine::IWindowTrackingService::preFloatScreen ( const QString &  windowId) const
pure virtual

◆ preFloatZones()

virtual QStringList PhosphorEngine::IWindowTrackingService::preFloatZones ( const QString &  windowId) const
pure virtual

◆ recordedSnapZones()

virtual QStringList PhosphorEngine::IWindowTrackingService::recordedSnapZones ( const QString &  windowId) const
pure virtual

A window's recorded snap zone(s), preferring the LIVE assignment but falling back to the DURABLE placement-record snap slot when the live cache is cold.

The live per-store zone maps are runtime-only — a daemon restart (and handoffRelease on autotile entry) clears them — so consumers that must survive a restart (the autotile→snap resnap) read this instead. Returns an empty list for a window that was never snapped in either source.

Implemented in PhosphorPlacement::WindowTrackingService.

◆ recordFreeGeometry()

virtual void PhosphorEngine::IWindowTrackingService::recordFreeGeometry ( const QString &  windowId,
const QString &  screenId,
const QRect &  geometry,
bool  overwrite 
)
pure virtual

Record a window's SHARED free/float geometry (the single float-back store — the placement record's freeGeometryByScreen).

This is the ONE writer all float-back captures route through (effect pre-tile/pre-snap capture, drag store, float-toggle capture), so snap and autotile read the same value and never drift. overwrite=false leaves an existing entry for screenId untouched (first-capture-wins). No-op on an invalid geometry.

Implemented in PhosphorPlacement::WindowTrackingService.

◆ recordSnapIntent()

virtual void PhosphorEngine::IWindowTrackingService::recordSnapIntent ( const QString &  windowId,
bool  wasUserInitiated 
)
pure virtual

◆ releaseEngineSlot()

virtual void PhosphorEngine::IWindowTrackingService::releaseEngineSlot ( const QString &  windowId,
const QString &  engineId 
)
inlinevirtual

Downgrade engineId's slot on windowId's record to WindowPlacement::stateReleased() and mark the placements dirty.

Called by an engine that KNOWINGLY gives a window up (cross-mode handoff), so its slot stops advertising a home the cross-screen reclaim would pull the window back to. Default no-op: an embedder without persistence has nothing to downgrade. NOT for ordinary close — a window that closed tiled keeps its slot, which is what login restore reads.

Reimplemented in PhosphorPlacement::WindowTrackingService.

◆ resolveEffectiveScreenId()

virtual QString PhosphorEngine::IWindowTrackingService::resolveEffectiveScreenId ( const QString &  screenId) const
pure virtual

◆ resolveZoneGeometry()

virtual QRect PhosphorEngine::IWindowTrackingService::resolveZoneGeometry ( const QStringList &  zoneIds,
const QString &  screenId 
) const
pure virtual

◆ screenForWindow() [1/2]

virtual QString PhosphorEngine::IWindowTrackingService::screenForWindow ( const QString &  windowId) const
pure virtual

The screen a window is assigned to (empty when none), canonicalizing the id so a window resolves across the effect-restart re-identification skew (#628).

There is deliberately no flat whole-map accessor on this interface: window placement is stored per (screen, desktop, activity) context, and a cross-store union erases the context that per-desktop consumers need.

Implemented in PhosphorPlacement::WindowTrackingService.

◆ screenForWindow() [2/2]

virtual QString PhosphorEngine::IWindowTrackingService::screenForWindow ( const QString &  windowId,
const QString &  defaultScreen 
) const
pure virtual

Same, returning defaultScreen when the window has no assignment.

Implemented in PhosphorPlacement::WindowTrackingService.

◆ screenManager()

virtual PhosphorScreens::ScreenManager * PhosphorEngine::IWindowTrackingService::screenManager ( ) const
pure virtual

◆ setWindowFloating()

virtual void PhosphorEngine::IWindowTrackingService::setWindowFloating ( const QString &  windowId,
bool  floating 
)
pure virtual

◆ takeResnapBuffer()

virtual QVector< ResnapEntry > PhosphorEngine::IWindowTrackingService::takeResnapBuffer ( )
pure virtual

◆ unassignWindow()

virtual void PhosphorEngine::IWindowTrackingService::unassignWindow ( const QString &  windowId)
pure virtual

◆ unsnapForFloat()

virtual void PhosphorEngine::IWindowTrackingService::unsnapForFloat ( const QString &  windowId)
pure virtual

◆ updateLastUsedZone()

virtual void PhosphorEngine::IWindowTrackingService::updateLastUsedZone ( const QString &  zoneId,
const QString &  screenId,
const QString &  windowClass,
int  virtualDesktop 
)
pure virtual

◆ validatedUnmanagedGeometry()

virtual std::optional< QRect > PhosphorEngine::IWindowTrackingService::validatedUnmanagedGeometry ( const QString &  windowId,
const QString &  screenId,
bool  exactOnly = false 
) const
pure virtual

The window's remembered UNMANAGED (free/float-back) geometry, resolved FOR screenId, or nullopt when no record can answer.

"Validated" describes the POSITION, not the size. The implementation prefers the spot remembered for screenId and otherwise falls back to one remembered on another screen, re-centring that rect on screenId (its absolute coordinates belong to the screen it was captured on, so only the SIZE carries over). So a non-null answer is not evidence the window was ever free on this screen.

exactOnly restricts the lookup to the window's OWN record. The default admits a same-app SIBLING's free geometry, which is deliberate cross-instance float-back sharing for free positions; pass exactOnly when the contract is per-window.

The SIZE is whatever the compositor last reported and is never bounded here. A caller minting a SIZING INTENT out of it (a Fixed column width, a fixed tile height) owes it a bound of its own — the extents are untrusted input from a compositor and, through the injected service, from an embedder. Callers that only re-place a window at a remembered spot need no such bound.

Implemented in PhosphorPlacement::WindowTrackingService.

◆ windowsInZone()

virtual QStringList PhosphorEngine::IWindowTrackingService::windowsInZone ( const QString &  zoneId) const
pure virtual

◆ zoneForWindow()

virtual QString PhosphorEngine::IWindowTrackingService::zoneForWindow ( const QString &  windowId) const
pure virtual

◆ zoneGeometry()

virtual QRect PhosphorEngine::IWindowTrackingService::zoneGeometry ( const QString &  zoneId,
const QString &  screenId = QString() 
) const
pure virtual

◆ zonesForWindow()

virtual QStringList PhosphorEngine::IWindowTrackingService::zonesForWindow ( const QString &  windowId) const
pure virtual

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