Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorCompositor::AutotileStateHelpers Namespace Reference

Compositor-agnostic autotile state accessors and pure helpers. More...

Classes

struct  AutotileWindowState
 Bundles per-window state maps for cleanup operations. More...
 

Functions

QString findSavedGeometryKey (const QHash< QString, QRectF > &savedGeometries, const QString &windowId)
 Find key in saved geometries map for a window (exact match only)
 
bool hasSavedGeometryForWindow (const QHash< QString, QRectF > &savedGeometries, const QString &windowId)
 Check if we already have saved geometry for this window.
 
bool isBorderlessWindow (const BorderState &border, const QString &windowId)
 
bool isTiledWindow (const BorderState &border, const QString &windowId)
 
bool shouldShowBorderForWindow (const BorderState &border, const QString &windowId)
 
bool shouldApplyBorderInset (const BorderState &border, const QString &windowId)
 
std::optional< QRect > borderZoneGeometry (const BorderState &border, const QString &windowId)
 
QVector< QRect > allBorderZoneGeometries (const BorderState &border)
 
QRect applyBorderInset (const QRect &geo, int borderWidth)
 Apply border inset to a geometry (shrink by border width on all sides)
 
bool shouldInsetForBorder (const BorderState &border, const QString &windowId, const QRect &geo)
 Check if border inset should be applied for a window's geometry.
 
void cleanupClosedWindowState (const QString &windowId, const QString &screenId, BorderState &border, AutotileWindowState &state)
 Clean up all state tracking for a closed window.
 
void addBorderlessOnScreen (BorderState &border, const QString &screenId, const QString &windowId)
 Add a window to a screen's borderless bucket. Idempotent.
 
void addTiledOnScreen (BorderState &border, const QString &screenId, const QString &windowId)
 Add a window to a screen's tiled bucket. Idempotent.
 
bool removeBorderlessOnScreen (BorderState &border, const QString &screenId, const QString &windowId)
 Remove a window from a specific screen's borderless bucket.
 
bool removeTiledOnScreen (BorderState &border, const QString &screenId, const QString &windowId)
 Remove a window from a specific screen's tiled bucket.
 
bool removeFromAllScreens (BorderState &border, const QString &windowId)
 Remove a window from all screen buckets (both borderless and tiled).
 
QSet< QString > tiledOnScreen (const BorderState &border, const QString &screenId)
 Read-only view of the set of tiled windows on a given screen. Empty if none.
 
QSet< QString > borderlessOnScreen (const BorderState &border, const QString &screenId)
 Read-only view of the set of borderless windows on a given screen. Empty if none.
 
QVector< QPair< QString, QString > > allBorderlessPairs (const BorderState &border)
 Collect every borderless (windowId, screenId) pair for bulk operations (feature disable, hide-titlebars toggle off).
 
QVector< QPair< QString, QString > > allTiledPairs (const BorderState &border)
 Same for tiled. Used by updateHideTitleBarsSetting's toggle-on path.
 

Detailed Description

Compositor-agnostic autotile state accessors and pure helpers.

These functions operate on BorderState and other pure data structures without touching any compositor APIs. Shared by all compositor plugins.

Function Documentation

◆ addBorderlessOnScreen()

void PhosphorCompositor::AutotileStateHelpers::addBorderlessOnScreen ( BorderState border,
const QString &  screenId,
const QString &  windowId 
)
inline

Add a window to a screen's borderless bucket. Idempotent.

◆ addTiledOnScreen()

void PhosphorCompositor::AutotileStateHelpers::addTiledOnScreen ( BorderState border,
const QString &  screenId,
const QString &  windowId 
)
inline

Add a window to a screen's tiled bucket. Idempotent.

◆ allBorderlessPairs()

QVector< QPair< QString, QString > > PhosphorCompositor::AutotileStateHelpers::allBorderlessPairs ( const BorderState border)
inline

Collect every borderless (windowId, screenId) pair for bulk operations (feature disable, hide-titlebars toggle off).

Returned as a flat vector so callers can iterate without holding a reference into the hash.

◆ allBorderZoneGeometries()

QVector< QRect > PhosphorCompositor::AutotileStateHelpers::allBorderZoneGeometries ( const BorderState border)
inline

◆ allTiledPairs()

QVector< QPair< QString, QString > > PhosphorCompositor::AutotileStateHelpers::allTiledPairs ( const BorderState border)
inline

Same for tiled. Used by updateHideTitleBarsSetting's toggle-on path.

◆ applyBorderInset()

QRect PhosphorCompositor::AutotileStateHelpers::applyBorderInset ( const QRect &  geo,
int  borderWidth 
)
inline

Apply border inset to a geometry (shrink by border width on all sides)

◆ borderlessOnScreen()

QSet< QString > PhosphorCompositor::AutotileStateHelpers::borderlessOnScreen ( const BorderState border,
const QString &  screenId 
)
inline

Read-only view of the set of borderless windows on a given screen. Empty if none.

◆ borderZoneGeometry()

std::optional< QRect > PhosphorCompositor::AutotileStateHelpers::borderZoneGeometry ( const BorderState border,
const QString &  windowId 
)
inline

◆ cleanupClosedWindowState()

void PhosphorCompositor::AutotileStateHelpers::cleanupClosedWindowState ( const QString &  windowId,
const QString &  screenId,
BorderState border,
AutotileWindowState state 
)
inline

Clean up all state tracking for a closed window.

Removes the window from all QSet/QHash state maps. Does NOT handle D-Bus calls or compositor-specific cleanup.

◆ findSavedGeometryKey()

QString PhosphorCompositor::AutotileStateHelpers::findSavedGeometryKey ( const QHash< QString, QRectF > &  savedGeometries,
const QString &  windowId 
)
inline

Find key in saved geometries map for a window (exact match only)

◆ hasSavedGeometryForWindow()

bool PhosphorCompositor::AutotileStateHelpers::hasSavedGeometryForWindow ( const QHash< QString, QRectF > &  savedGeometries,
const QString &  windowId 
)
inline

Check if we already have saved geometry for this window.

◆ isBorderlessWindow()

bool PhosphorCompositor::AutotileStateHelpers::isBorderlessWindow ( const BorderState border,
const QString &  windowId 
)
inline

◆ isTiledWindow()

bool PhosphorCompositor::AutotileStateHelpers::isTiledWindow ( const BorderState border,
const QString &  windowId 
)
inline

◆ removeBorderlessOnScreen()

bool PhosphorCompositor::AutotileStateHelpers::removeBorderlessOnScreen ( BorderState border,
const QString &  screenId,
const QString &  windowId 
)
inline

Remove a window from a specific screen's borderless bucket.

Returns true if it was present. Erases the bucket if it becomes empty.

◆ removeFromAllScreens()

bool PhosphorCompositor::AutotileStateHelpers::removeFromAllScreens ( BorderState border,
const QString &  windowId 
)
inline

Remove a window from all screen buckets (both borderless and tiled).

Returns true if any bucket contained it.

◆ removeTiledOnScreen()

bool PhosphorCompositor::AutotileStateHelpers::removeTiledOnScreen ( BorderState border,
const QString &  screenId,
const QString &  windowId 
)
inline

Remove a window from a specific screen's tiled bucket.

Returns true if it was present. Erases the bucket if it becomes empty.

◆ shouldApplyBorderInset()

bool PhosphorCompositor::AutotileStateHelpers::shouldApplyBorderInset ( const BorderState border,
const QString &  windowId 
)
inline

◆ shouldInsetForBorder()

bool PhosphorCompositor::AutotileStateHelpers::shouldInsetForBorder ( const BorderState border,
const QString &  windowId,
const QRect &  geo 
)
inline

Check if border inset should be applied for a window's geometry.

◆ shouldShowBorderForWindow()

bool PhosphorCompositor::AutotileStateHelpers::shouldShowBorderForWindow ( const BorderState border,
const QString &  windowId 
)
inline

◆ tiledOnScreen()

QSet< QString > PhosphorCompositor::AutotileStateHelpers::tiledOnScreen ( const BorderState border,
const QString &  screenId 
)
inline

Read-only view of the set of tiled windows on a given screen. Empty if none.