Automatic-tiling placement engine. Implements IPlacementEngine for screens running an autotile algorithm; handles dynamic re-layout on window open / close / focus, navigation, ratio / master-count adjustments, per-screen overrides, and overflow auto-floating.
`phosphor-tiles` owns the algorithms themselves (TilingAlgorithm, TilingState, the Luau algorithm binding). phosphor-tile-engine is the runtime engine that drives those algorithms in response to compositor events. Splitting them lets settings UI render an algorithm preview without linking the engine, and lets engine work iterate without touching the algorithm vocabulary.
The engine manages:
| Type | Purpose |
|---|---|
| PhosphorTileEngine::AutotileEngine | Concrete IPlacementEngine for autotile screens |
| PhosphorTileEngine::AutotileConfig | Global config: default algorithm, gaps, master count, per-algorithm AlgorithmSettings map |
| PhosphorEngine::IAutotileSettings | Settings contract the engine reads (declared in PhosphorEngine, implementation ships from here) |
| PhosphorTileEngine::NavigationController | Stateless helper for focus / swap / rotate / split-ratio / master-count |
| PhosphorTileEngine::OverflowManager | Per-screen tracking of auto-floated windows when maxWindows is exceeded |
| PhosphorTileEngine::PerScreenConfigResolver | Resolves per-screen overrides → global config |
| PhosphorTileEngine::AlgorithmSettings | Per-algorithm split ratio + master count + custom params (saved on switch-away) |
Wire up the engine inside the daemon's composition root:
#include <PhosphorTileEngine/AutotileEngine.h>
using namespace PhosphorTileEngine;
auto* autotile = new AutotileEngine(layoutRegistry, // from phosphor-zones
windowTrackingService,
screenManager,
algorithmRegistry, // from phosphor-tiles
/*parent*/ daemon);
autotile->setWindowRegistry(windowRegistry); // late-bound app-id resolver
autotile->setEngineSettings(autotileSettingsAdaptor); // base-class settings wiring
autotile->refreshConfigFromSettings(); // pull initial config from settings
placementEngineRouter.bind("autotile", autotile);