Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorTileEngine::NavigationController Class Reference

Handles navigation, focus cycling, and ratio/count adjustments. More...

#include <phosphor-tile-engine/include/PhosphorTileEngine/NavigationController.h>

Public Member Functions

 NavigationController (AutotileEngine *engine)
 
void focusNext ()
 
void focusPrevious ()
 
void focusMaster ()
 
void swapFocusedWithMaster ()
 
void rotateWindowOrder (bool clockwise)
 
void swapFocusedInDirection (const QString &direction, const QString &action, const QString &explicitWindowId=QString())
 explicitWindowId (when non-empty) overrides the state's internal focusedWindow() for the operation.
 
void focusInDirection (const QString &direction, const QString &action, const QString &explicitWindowId=QString())
 
void moveFocusedToPosition (int position, const QString &explicitWindowId=QString())
 
void increaseMasterRatio (qreal delta)
 
void decreaseMasterRatio (qreal delta)
 
void setGlobalSplitRatio (qreal ratio)
 
void setGlobalMasterCount (int count)
 
void adjustMasterCount (int delta)
 
QString entryWindowOnScreen (const QString &screenId, const QString &direction) const
 The tiled window at screenId's entry edge facing the source when a crossing arrives in direction (crossing "right" enters the target's LEFT edge → the leftmost tile, etc.).
 
int windowOrderIndexOnScreen (const QString &screenId, const QString &windowId) const
 The RAW window-order index of windowId on screenId's current state (counting floating windows, as TilingState::addWindow does), or -1 when not present.
 

Detailed Description

Handles navigation, focus cycling, and ratio/count adjustments.

NavigationController is a stateless helper extracted from AutotileEngine. It manages keyboard-driven navigation (focus next/previous/master), window swapping, rotation, directional focus/swap, position moves, and master ratio/count adjustments.

Stateless — no member data moves from AutotileEngine. All state is accessed via the back-pointer to AutotileEngine.

See also
AutotileEngine for the owning engine

Constructor & Destructor Documentation

◆ NavigationController()

PhosphorTileEngine::NavigationController::NavigationController ( AutotileEngine engine)
explicit

Member Function Documentation

◆ adjustMasterCount()

void PhosphorTileEngine::NavigationController::adjustMasterCount ( int  delta)

◆ decreaseMasterRatio()

void PhosphorTileEngine::NavigationController::decreaseMasterRatio ( qreal  delta)

◆ entryWindowOnScreen()

QString PhosphorTileEngine::NavigationController::entryWindowOnScreen ( const QString &  screenId,
const QString &  direction 
) const

The tiled window at screenId's entry edge facing the source when a crossing arrives in direction (crossing "right" enters the target's LEFT edge → the leftmost tile, etc.).

Empty when the screen has no tiling state or no tiled windows. Used by the daemon to pick the cross-mode swap partner on an autotile target.

Note
When geometry isn't computed yet OR the screen is over its maxWindows cap (calculatedZones covers only the capped subset, so it can't align 1:1 with tiledWindows), this degrades to the first tiled window (the master) rather than the geometric edge tile.

◆ focusInDirection()

void PhosphorTileEngine::NavigationController::focusInDirection ( const QString &  direction,
const QString &  action,
const QString &  explicitWindowId = QString() 
)

◆ focusMaster()

void PhosphorTileEngine::NavigationController::focusMaster ( )

◆ focusNext()

void PhosphorTileEngine::NavigationController::focusNext ( )

◆ focusPrevious()

void PhosphorTileEngine::NavigationController::focusPrevious ( )

◆ increaseMasterRatio()

void PhosphorTileEngine::NavigationController::increaseMasterRatio ( qreal  delta)

◆ moveFocusedToPosition()

void PhosphorTileEngine::NavigationController::moveFocusedToPosition ( int  position,
const QString &  explicitWindowId = QString() 
)

◆ rotateWindowOrder()

void PhosphorTileEngine::NavigationController::rotateWindowOrder ( bool  clockwise)

◆ setGlobalMasterCount()

void PhosphorTileEngine::NavigationController::setGlobalMasterCount ( int  count)

◆ setGlobalSplitRatio()

void PhosphorTileEngine::NavigationController::setGlobalSplitRatio ( qreal  ratio)

◆ swapFocusedInDirection()

void PhosphorTileEngine::NavigationController::swapFocusedInDirection ( const QString &  direction,
const QString &  action,
const QString &  explicitWindowId = QString() 
)

explicitWindowId (when non-empty) overrides the state's internal focusedWindow() for the operation.

The IPlacementEngine virtual-method overrides on AutotileEngine pass ctx.windowId here so navigation follows the daemon's authoritative focus tracking even when the engine's per-state focusedWindow tracker is stale.

◆ swapFocusedWithMaster()

void PhosphorTileEngine::NavigationController::swapFocusedWithMaster ( )

◆ windowOrderIndexOnScreen()

int PhosphorTileEngine::NavigationController::windowOrderIndexOnScreen ( const QString &  screenId,
const QString &  windowId 
) const

The RAW window-order index of windowId on screenId's current state (counting floating windows, as TilingState::addWindow does), or -1 when not present.

Lets the daemon capture a window's slot before a cross-mode swap so its counterpart lands in the same place when re-inserted via HandoffContext.insertIndex.


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