Per-screen overflow window tracking (pure tracking — no PhosphorTiles::TilingState mutation) More...
#include <phosphor-tile-engine/include/PhosphorTileEngine/OverflowManager.h>
Public Member Functions | |
| void | markOverflow (const QString &windowId, const QString &screenId) |
| Mark a window as overflow on a specific screen. | |
| void | clearOverflow (const QString &windowId) |
| Clear overflow status for a window (any screen) | |
| bool | isOverflow (const QString &windowId) const |
| Check if a window is currently overflow-tracked. | |
| QStringList | applyOverflow (const QString &screenId, const QStringList &windows, int tileCount) |
| Identify windows beyond tileCount that should be auto-floated. | |
| QStringList | recoverIfRoom (const QString &screenId, int tiledCount, int maxWindows, const std::function< bool(const QString &)> &isFloating, const std::function< bool(const QString &)> &containsWindow) |
| Identify overflow windows that should be unfloated when room opens. | |
| QSet< QString > | takeForScreen (const QString &screenId) |
| Take and remove all overflow entries for a screen. | |
| void | migrateWindow (const QString &windowId) |
| Clear overflow status when a window migrates between screens. | |
| void | clearForRemovedScreens (const QSet< QString > &activeScreens) |
| Clear overflow entries for windows on screens not in the active set. | |
| bool | isEmpty () const |
| Check if there are any overflow windows tracked. | |
Per-screen overflow window tracking (pure tracking — no PhosphorTiles::TilingState mutation)
Manages the bookkeeping for windows that are auto-floated when the tiled window count exceeds maxWindows. Uses per-screen storage (QHash<screenId, QSet<windowId>>) plus a reverse index (windowId -> screenId) for O(1) lookups.
Distinguished from user-floated windows so they can be auto-unfloated when room becomes available (e.g., window closed, maxWindows increased).
This class does NOT mutate PhosphorTiles::TilingState. It returns lists of window IDs that should be floated/unfloated and the caller performs the mutations and signal emissions.
| QStringList PhosphorTileEngine::OverflowManager::applyOverflow | ( | const QString & | screenId, |
| const QStringList & | windows, | ||
| int | tileCount | ||
| ) |
Identify windows beyond tileCount that should be auto-floated.
Marks the excess windows as overflow. Does NOT call state->setFloating(); the caller is responsible for mutating PhosphorTiles::TilingState and emitting signals.
| windowsInState | List of all tiled windows (from PhosphorTiles::TilingState) |
| isFloating | Predicate: returns true if a window is already floating |
| screenId | Screen where overflow is being applied |
| windows | Ordered window list from PhosphorTiles::TilingState::tiledWindows() |
| tileCount | Number of available tile zones |
| void PhosphorTileEngine::OverflowManager::clearForRemovedScreens | ( | const QSet< QString > & | activeScreens | ) |
Clear overflow entries for windows on screens not in the active set.
Used during screen deactivation to clean up orphaned overflow entries that weren't caught by takeForScreen().
| activeScreens | Set of currently active autotile screen names |
| void PhosphorTileEngine::OverflowManager::clearOverflow | ( | const QString & | windowId | ) |
Clear overflow status for a window (any screen)
Uses the reverse index for O(1) lookup — no screen parameter needed.
| bool PhosphorTileEngine::OverflowManager::isEmpty | ( | ) | const |
Check if there are any overflow windows tracked.
| bool PhosphorTileEngine::OverflowManager::isOverflow | ( | const QString & | windowId | ) | const |
Check if a window is currently overflow-tracked.
| void PhosphorTileEngine::OverflowManager::markOverflow | ( | const QString & | windowId, |
| const QString & | screenId | ||
| ) |
Mark a window as overflow on a specific screen.
If the window was previously tracked on a different screen, the old entry is cleaned up first to prevent ghost references. No-op if windowId or screenId is empty.
| void PhosphorTileEngine::OverflowManager::migrateWindow | ( | const QString & | windowId | ) |
Clear overflow status when a window migrates between screens.
Uses the internal reverse index to find the correct per-screen set, ignoring the oldScreen hint (which may have diverged from the overflow manager's own tracking during cross-screen migration). The caller re-adds the window to the new screen's normal flow via onWindowAdded().
| QStringList PhosphorTileEngine::OverflowManager::recoverIfRoom | ( | const QString & | screenId, |
| int | tiledCount, | ||
| int | maxWindows, | ||
| const std::function< bool(const QString &)> & | isFloating, | ||
| const std::function< bool(const QString &)> & | containsWindow | ||
| ) |
Identify overflow windows that should be unfloated when room opens.
Also purges stale entries (windows no longer floating or not in PhosphorTiles::TilingState) to prevent overflow tracking from growing unbounded.
Does NOT call state->setFloating(); the caller performs mutations.
| screenId | Screen to check for recovery |
| tiledCount | Current number of tiled (non-floating) windows |
| maxWindows | Maximum windows allowed on the screen |
| isFloating | Predicate: returns true if window is currently floating |
| containsWindow | Predicate: returns true if window exists in PhosphorTiles::TilingState |
| QSet< QString > PhosphorTileEngine::OverflowManager::takeForScreen | ( | const QString & | screenId | ) |
Take and remove all overflow entries for a screen.