6#include "phosphortileengine_export.h"
41struct TileEvacueePark;
89 return m_algorithmRegistry;
165 const QString canonical = canonicalizeForLookup(windowId);
166 const auto* state = m_states.forWindow(canonical);
167 return state && state->containsWindow(canonical);
241 return m_context.stickyPinnedDesktop(screenId);
270 return m_autotileScreens;
279 return m_activeScreen;
331 m_crossSurfaceResolver = resolver;
403 return m_context.currentDesktop();
411 return m_context.currentActivity();
499 m_persistSaveFn = std::move(saveFn);
500 m_persistLoadFn = std::move(loadFn);
530 m_restorePositionPredicate = std::move(predicate);
549 using FloatPredicate = std::function<bool(
const QString& windowId,
const QString& screenId)>;
553 m_floatPredicate = std::move(predicate);
573 return m_states.keyForWindow(canonicalizeForLookup(windowId)).screenId;
595 void onWindowResized(
const QString& rawWindowId,
const QRect& oldFrame,
const QRect& newFrame,
596 const QString& screenId)
override;
622 using ContextTilesResolver = std::function<bool(
const QString& screenId,
int desktop,
const QString& activity)>;
625 m_contextModeResolver = std::move(resolver);
632 std::function<
bool(
const QString& screenId,
int desktop,
const QString& activity)> resolver)
634 m_scrollingModeResolver = std::move(resolver);
704 const QString& windowId);
735 Q_INVOKABLE
void retile(
const QString& screenId = QString())
override;
743 Q_INVOKABLE
void swapWindows(
const QString& windowId1,
const QString& windowId2);
959 Q_INVOKABLE
void focusInDirection(
const QString& direction,
const QString& action = QStringLiteral(
"focus"));
997 std::optional<PhosphorEngine::WindowPlacement>
capturePlacement(
const QString& windowId)
const override;
1003 std::optional<PhosphorEngine::WindowPlacement>
1032 const QString& screenId = QString())
override;
1091 using IPlacementEngine::windowOpened;
1092 void windowOpened(
const QString& windowId,
const QString& screenId,
int minWidth,
int minHeight)
override;
1103 int minHeight)
override;
1106 std::optional<PhosphorEngine::PlacementStateKey>
heldKeyForWindow(
const QString& windowId)
const override;
1110 QStringList
parkOutput(
const QString& physicalScreenId)
override;
1112 const QString& returnedPhysicalId)
override;
1113 void dropParked(
const QString& windowId,
const QString& physicalScreenId,
int desktop,
1114 const QString& activity)
override;
1115 bool hasParked(
const QString& windowId,
const QString& physicalScreenId)
const override;
1281 return m_dragInsertPreview.has_value();
1291 return m_dragInsertPreview ? m_dragInsertPreview->windowId : QString();
1299 return m_dragInsertPreview ? m_dragInsertPreview->targetScreenId : QString();
1311 return m_dragInsertPreview && m_dragInsertPreview->hadPriorState ? m_dragInsertPreview->priorKey.screenId
1399 void onWindowAdded(
const QString& windowId);
1400 void onWindowRemoved(
const QString& windowId);
1401 void onWindowFocused(
const QString& windowId);
1402 void onScreenGeometryChanged(
const QString& screenId);
1406 void connectSignals();
1407 bool insertWindow(
const QString& windowId,
const QString& screenId);
1409 QList<QSize> managedSizesOnScreen(
const QString& screenId)
const;
1414 void emitInsertFloatStateSync(
const QString& windowId,
const QString& screenId);
1420 void installContextResolver();
1421 struct PendingMembership;
1422 void collectMembershipWork(
const QString& windowId,
const QString& screenId,
1425 QList<PendingMembership>& pending)
const;
1428 const QList<PendingMembership>& pending);
1441 void retileIfDirtyBackground(
const QString& screenId);
1447 void removeWindow(
const QString& windowId);
1454 QString removeTrackedWindowNoRetile(
const QString& windowId);
1460 void dropClosedWindowFromDragPreview(
const QString& windowId);
1461 bool storeWindowMinSize(
const QString& windowId,
int minWidth,
int minHeight);
1462 bool recalculateLayout(
const QString& screenId);
1463 void applyTiling(
const QString& screenId);
1475 const QRect& newFrame,
const QString& screenId);
1476 bool shouldTileWindow(
const QString& windowId)
const;
1477 QString screenForWindow(
const QString& windowId)
const;
1478 QRect screenGeometry(
const QString& screenId)
const;
1483 bool isKnownScreen(
const QString& screenId)
const;
1519 QStringList& releasedWindows,
bool drainOverflow =
true,
1520 bool clearScreenOrderMaps =
true);
1558 const QString& newScreenId);
1570 void revalidateWindowContext(
const QString& windowId,
const QString& screenId);
1585 return m_context.currentKeyForScreen(screenId);
1595 enum class PropagateScope {
1603 void propagateGlobalSplitRatio(PropagateScope scope = PropagateScope::CurrentContext);
1608 void propagateGlobalMasterCount(PropagateScope scope = PropagateScope::CurrentContext);
1621 void backfillWindows();
1635 void retileScreen(
const QString& screenId);
1646 void scheduleRetileRetry(
const QString& screenId);
1651 void processRetileRetries();
1667 bool cleanupPendingOrderIfResolved(
const QString& screenId);
1668 void schedulePendingOrderTimeout(
const QString& screenId, uint64_t generation);
1676 bool warnIfEmptyWindowId(
const QString& windowId,
const char* operation)
const;
1693 QString canonicalizeWindowId(
const QString& rawWindowId);
1701 void cleanupCanonical(
const QString& anyWindowId);
1713 void purgePendingFocusForWindow(
const QString& windowId);
1729 void sweepPhantomTracking(
const QString& windowId);
1738 QString canonicalizeForLookup(
const QString& rawWindowId)
const;
1752 QString currentAppIdFor(
const QString& anyWindowId)
const;
1780 void toggleWindowFloatAs(
const QString& rawWindowId,
const QString& screenId,
const QString& failureAction);
1793 QSet<QString> m_autotileFloatedWindows;
1797 std::function<bool(
const QString& screenId,
int desktop,
const QString& activity)> m_scrollingModeResolver;
1808 QMetaObject::Connection m_appIdResolverHook;
1810 std::unique_ptr<AutotileConfig> m_config;
1811 std::unique_ptr<PerScreenConfigResolver> m_configResolver;
1812 std::unique_ptr<NavigationController> m_navigation;
1813 QTimer m_writeBackGuardTimer;
1814 QTimer m_settingsRetileTimer;
1817 std::function<void()> m_persistSaveFn;
1818 std::function<void()> m_persistLoadFn;
1823 RestorePositionPredicate m_restorePositionPredicate{};
1826 FloatPredicate m_floatPredicate{};
1829 using MigrationArrival = ::PhosphorTileEngine::MigrationArrival;
1830 std::optional<MigrationArrival> m_migrationArrival;
1832 QSet<QString> m_crossScreenClaimsExhausted;
1836 bool insertShouldFloat(
const QString& windowId,
const QString& screenId)
const;
1838 QSet<QString> m_autotileScreens;
1839 QString m_algorithmId;
1840 bool m_algorithmEverSet =
false;
1848 bool m_refreshingFromSettings =
false;
1849 QString m_activeScreen;
1856 PhosphorEngine::PerScreenStates<PhosphorTiles::TilingState> m_states;
1867 QSet<PhosphorEngine::TilingStateKey> m_userTunedSplitRatio;
1868 QSet<PhosphorEngine::TilingStateKey> m_userTunedMasterCount;
1875 using StashedScriptState = ::PhosphorTileEngine::StashedScriptState;
1876 std::unordered_map<PhosphorEngine::TilingStateKey, StashedScriptState> m_scriptStateStash;
1913 const PhosphorTiles::TilingAlgorithm* algo);
1922 void dropStashedScriptStatesForAlgorithmChange(
const QString& screenId,
const QString& newAlgorithmId);
1924 QHash<QString, QSize> m_windowMinSizes;
1942 QHash<QString, QRect> m_lastAppliedTileRect;
1954 QHash<QString, QString> m_canonicalByInstance;
1962 PhosphorEngine::ScreenContextTracker m_context;
1967 bool m_isDesktopContextSwitch =
false;
1980 QHash<QString, QStringList> m_pendingInitialOrders;
1981 QHash<QString, uint64_t> m_pendingOrderGeneration;
1987 uint64_t m_pendingOrderSerial = 0;
2003 QSet<QString> m_strictInitialOrderScreens;
2006 OverflowManager m_overflow;
2008 bool m_retiling =
false;
2014 QSet<QString> m_pendingRetileScreens;
2021 QSet<PhosphorEngine::TilingStateKey> m_dirtyBackgroundContexts;
2022 bool m_retilePending =
false;
2029 static constexpr int MaxRetileRetries = 3;
2030 static constexpr int RetileRetryIntervalMs = 150;
2031 QTimer m_retileRetryTimer;
2032 QSet<QString> m_retileRetryScreens;
2033 QHash<QString, int> m_retileRetryCount;
2041 QHash<QString, QString> m_pendingFocusByScreen;
2048 QString m_pendingFocusReseedWindowId;
2052 using DragInsertPreview = ::PhosphorTileEngine::DragInsertPreview;
2053 std::optional<DragInsertPreview> m_dragInsertPreview;
2059 QString m_dragCancelFilterWindowId;
2066 QString m_interactiveDragWindow;
2074 void processPendingRetiles();
2077 std::optional<std::pair<int, bool>> takeGrantedParkedPlace(
const QString& windowId,
2079 PhosphorTiles::TilingState* state);
2084 std::unique_ptr<TileEvacueePark> m_evacueePark;
2085 ContextTilesResolver m_contextModeResolver;
How KWin's desktop positions moved in one change of its desktop list: for each 1-based position in th...
Definition DesktopRemap.h:29
Definition IAutotileSettings.h:15
Resolves the neighbouring surface — output or virtual desktop — in a direction, for cross-surface win...
Definition ICrossSurfaceResolver.h:21
static constexpr qreal kDefaultSplitRatioStep
One home for the master/split ratio step so the default return below and the two default arguments ca...
Definition IPlacementEngine.h:1147
LayoutSupport
How this engine relates to user-selectable layouts — the entries the layout picker,...
Definition IPlacementEngine.h:955
@ Placement
Layouts drive window placement (snap zone layouts, autotile algorithm cards): the classic picker sema...
Definition IPlacementEngine.h:962
Definition IWindowRegistry.h:49
Definition IWindowTrackingService.h:35
Abstract base class for placement engines.
Definition PlacementEngineBase.h:36
void algorithmChanged(const QString &algorithmId)
Emitted when the active tiling algorithm changes.
Centralized screen-topology service.
Definition Manager.h:86
void snapAllWindows(const PhosphorEngine::NavigationContext &ctx) override
Bring every unmanaged window on the screen back under this engine's placement (zones for snap,...
void setGlobalMasterCount(int count)
Set master count globally (config + every state, every desktop).
QSet< QString > activeScreens() const override
Definition AutotileEngine.h:212
void setCurrentDesktop(int desktop) override
Set the current virtual desktop for per-desktop tiling state.
void promoteToMaster(const QString &windowId)
Promote a window to the master area.
void pruneStatesForActivities(const QStringList &validActivities) override
Prune PhosphorTiles::TilingState entries for activities not in the given set.
void updateStickyScreenPins(const PhosphorEngine::StickyPredicate &, PhosphorEngine::StickyPinPhase) override
Pin screens where all autotiled windows are sticky (on all desktops).
friend class NavigationController
Definition AutotileEngine.h:76
PhosphorEngine::MembershipReconcileResult reconcileDesktopMemberships(const QString &screenId, const PhosphorEngine::DesktopSpanQuery &spanOf) override
Give a window a tile on every desktop it occupies.
bool effectiveSmartGaps(const QString &screenId) const
void pruneStatesForRemovedScreen(const QString &physicalScreenId) override
Prune PhosphorTiles::TilingState entries for a permanently removed monitor.
void swapFocusedInDirection(const QString &direction, const PhosphorEngine::NavigationContext &ctx) override
Swap the focused window with the adjacent window.
QString dragInsertPreviewWindowId() const
Get the window ID of the active drag-insert preview, or empty.
Definition AutotileEngine.h:1289
void clearModeSpecificFloatMarker(const QString &windowId) override
Definition AutotileEngine.h:247
void setFocusNewWindows(bool enabled)
QString algorithmId() const override
Definition AutotileEngine.h:255
QStringList parkOutput(const QString &physicalScreenId) override
Copy every context of physicalScreenId (each of its virtual screens) into the park,...
void retileAfterOperation(const QString &screenId, bool operationSucceeded)
Helper to retile a screen after a window operation.
void decreaseMasterRatio(qreal delta=kDefaultSplitRatioStep) override
Decrease the master area ratio.
void setRestorePositionPredicate(RestorePositionPredicate predicate)
Inject the floated-position-restore gate.
Definition AutotileEngine.h:528
void increaseMasterCount() override
Increase the number of master windows.
std::function< bool(const QString &windowId, const QString &screenId)> FloatPredicate
Predicate deciding whether an opening window should start FLOATING because a "Float this app" rule ma...
Definition AutotileEngine.h:549
void setGlobalSplitRatio(qreal ratio)
Set master ratio globally (config + every state, every desktop).
void purgeFromPendingOrders(const QString &windowId)
Purge windowId from every pending initial order, with full bookkeeping: empty orders drop their gener...
PhosphorEngine::IAutotileSettings * autotileSettings() const
void setFloatPredicate(FloatPredicate predicate)
Definition AutotileEngine.h:551
QStringList tiledWindowOrder(const QString &screenId) const
Get the current tiled window order for a screen.
void reapplyLayout(const PhosphorEngine::NavigationContext &ctx) override
Re-apply the current layout to all managed windows.
QSet< int > desktopsWithActiveState() const override
The virtual-desktop numbers any per-context entry names: a state, a parked context,...
bool effectiveRespectMinimumSize(const QString &screenId) const
void applyPerScreenConfig(const QString &screenId, const QVariantMap &overrides) override
void windowFocused(const QString &windowId, const QString &screenId) override
Notify the engine that a window was focused.
void toggleFocusedWindowFloat()
Toggle the focused window between tiled and floating states.
QStringList capturedWindowOrder(const QString &screenId) const
void commitDragInsertPreview() override
Commit the active drag-insert preview.
bool isWindowTiled(const QString &rawWindowId) const override
Check if a window is currently tiled (tracked AND not floating).
QString dragInsertPreviewScreenId() const override
Get the target screen ID of the active drag-insert preview, or empty.
Definition AutotileEngine.h:1297
void moveFocusedToPosition(int position)
Move the focused window to a specific position in the tiling order.
void markAutotileFloated(const QString &rawWindowId)
void refreshConfigFromSettings() override
Re-read all tuning values from the engine's settings interface.
void moveFocusedInDirection(const QString &direction, const PhosphorEngine::NavigationContext &ctx) override
Move the focused window to the adjacent slot.
PhosphorEngine::MembershipReconcileResult reconcileWindowMemberships(const QString &windowId, const PhosphorEngine::DesktopSpanQuery &spanOf) override
The same pass for ONE window, on the screen it is held on.
bool isActiveOnScreen(const QString &screenId) const override
Whether this engine is active on the given screen.
PhosphorTiles::TilingState * tilingStateForScreen(const QString &screenId)
Get the tiling state for a specific screen.
void setSmartGaps(bool enabled)
void setCrossSurfaceResolver(PhosphorEngine::ICrossSurfaceResolver *resolver) override
Inject the cross-surface resolver (neighbouring output / desktop lookup) used by directional navigati...
Definition AutotileEngine.h:329
void setOuterGap(int gap)
int currentDesktop() const noexcept
Get the current virtual desktop tracked by the engine.
Definition AutotileEngine.h:401
void windowOpened(const QString &windowId, const QString &screenId, int minWidth, int minHeight) override
A new window appeared on this engine's screen.
int windowOrderIndexForWindow(const QString &screenId, const QString &windowId) const
The RAW window-order index of windowId on screenId (current desktop; counts floats,...
void windowsTiled(const QString &tileRequestsJson)
Emitted when windows are tiled to new geometries (batch).
void rotateWindowOrder(bool clockwise=true)
Rotate all tiled windows by one position.
void scheduleRetileForScreen(const QString &screenId) override
Schedule a deferred retile for a screen.
void loadState() override
Load tiling state via persistence delegate (IPlacementEngine contract).
void windowMinSizeUpdated(const QString &windowId, int minWidth, int minHeight) override
A window's minimum size changed after windowOpened (0 when unconstrained): retiles when it differs fr...
std::optional< PhosphorEngine::PlacementStateKey > heldKeyForWindow(const QString &windowId) const override
The (screen, desktop, activity) key of the state that genuinely holds windowId, tiled or floating,...
void pushToEmptyZone(const PhosphorEngine::NavigationContext &ctx) override
Move the focused window to the first empty slot.
void swapWindows(const QString &windowId1, const QString &windowId2)
Swap positions of two tiled windows.
void setInnerGap(int gap)
void saveState() override
Save tiling state via persistence delegate (IPlacementEngine contract).
void toggleFocusedFloat(const PhosphorEngine::NavigationContext &ctx) override
Toggle the focused window between managed and floating.
void dropParked(const QString &windowId, const QString &physicalScreenId, int desktop, const QString &activity) override
Forget windowId's parked contexts; an empty physicalScreenId, a desktop of 0 or an empty activity mat...
void setCurrentDesktopForScreen(const QString &screenId, int desktop) override
Set a single screen's current virtual desktop (Plasma 6.7 per-output virtual desktops,...
void focusPrevious()
Focus the previous tiled window.
void clearScreenScheduling(const QString &screenId)
Drop every per-screen SCHEDULING entry for screenId: pending retiles, retile retry state,...
void toggleWindowFloat(const QString &windowId, const QString &screenId) override
Toggle a specific window between tiled and floating states.
PhosphorTiles::ITileAlgorithmRegistry * algorithmRegistry() const
The injected tile-algorithm registry. Borrowed — owner outlives the engine.
Definition AutotileEngine.h:87
bool hasDragInsertPreview() const override
Query whether a drag-insert preview is currently active.
Definition AutotileEngine.h:1279
QStringList managedWindowOrder(const QString &screenId) const override
Capture-on-leave order: the tiled order PLUS minimize-floated windows at their windowOrder positions.
Definition AutotileEngine.h:227
bool isAutotileFloated(const QString &rawWindowId) const
void clearPerScreenConfig(const QString &screenId) override
void setInitialWindowOrder(const QString &screenId, const QStringList &windowIds) override
Pre-seed initial window order for deterministic snapping → autotile transitions.
void setWindowFloat(const QString &windowId, bool shouldFloat, const QString &screenId=QString()) override
Set the floating state of a specific window.
void setInteractiveDragWindow(const QString &windowId) override
Mark windowId as under a compositor interactive move (IPlacementEngine contract).
void cycleFocus(bool forward, const PhosphorEngine::NavigationContext &ctx) override
Cycle keyboard focus through managed windows.
void moveFocusedToPosition(int position, const PhosphorEngine::NavigationContext &ctx) override
Move the focused window to the Nth position.
void decreaseMasterCount() override
Decrease the number of master windows.
void noteMasterCountUserTuned(const QString &screenId)
AutotileConfig * config() const noexcept
Get the autotile configuration.
void focusNext()
Focus the next tiled window.
void rotateWindows(bool clockwise, const QString &screenId)
int effectiveInnerGap(const QString &screenId) const
PhosphorEngine::IPlacementState * stateForScreen(const QString &screenId) override
Per-screen state object for the given screen.
void floatWindow(const QString &windowId)
Float a specific window by its ID (convenience forwarder).
void remapDesktops(const PhosphorEngine::DesktopRemap &remap) override
OPTIONAL: KWin's desktop list changed (a removal, an insert or a reorder).
QString algorithm() const noexcept
Get current algorithm ID.
void spanFocusedInDirection(const QString &direction, const PhosphorEngine::NavigationContext &ctx) override
Grow or shrink the focused window's zone span toward the direction: extend into the adjacent zone(s) ...
DragInsertTarget computeDragInsertTargetAtPoint(const QString &screenId, const QPoint &cursorPos) const override
IPlacementEngine drop-target form: wraps the flat index into DragInsertTarget::primary (invalid when ...
void autotileScreensChanged(const QStringList &screenIds, bool isDesktopSwitch)
Emitted when the set of autotile screens changes.
void focusInDirection(const QString &direction, const QString &action=QStringLiteral("focus"))
Focus the adjacent window in tiling order with OSD feedback.
std::function< bool(const QString &windowId, const QString &screenIdHint)> RestorePositionPredicate
Predicate consulted on reopen to decide whether a FLOATED (untiled) window should have its previous g...
Definition AutotileEngine.h:524
void increaseMasterRatio(qreal delta=kDefaultSplitRatioStep) override
Increase the master area ratio.
bool isWindowManaged(const QString &windowId) const override
Whether the engine considers the window "managed" (eligible for layout operations).
Definition AutotileEngine.h:251
void updatePerScreenOverride(const QString &screenId, const QString &key, const QVariant &value)
int pruneStaleWindows(const QSet< QString > &aliveWindowIds) override
Drop any per-engine bookkeeping for windows not in aliveWindowIds.
void noteCrossScreenClaimsExhausted(const QString &windowId, bool exhausted) override
INERT, kept for ABI: fed the removed cross-screen defer gates.
void setActiveScreens(const QSet< QString > &screens) override
Definition AutotileEngine.h:216
QString entryWindowForCrossing(const QString &screenId, const QString &direction) const
Cross-mode swap support (queried by the daemon when THIS engine is the target): the tiled window at s...
bool isWindowTracked(const QString &windowId) const override
Check if a window is currently tracked in any autotile state.
Definition AutotileEngine.h:159
QString managedFocusedWindow(const QString &screenId) const override
Capture half only.
bool hasPerScreenOverride(const QString &screenId, const QString &key) const
void focusMaster() override
Focus the master window.
void switchFocusBetweenFloatingAndTiling(const QString &screenId) override
Jump focus between the float layer and the tiled layout.
PhosphorTiles::AutotileInsertPosition effectiveInsertPosition(const QString &screenId) const
bool isWindowFloatingInAutotile(const QString &windowId) const
Authoritative per-window autotile float state.
PhosphorTiles::TilingAlgorithm * currentAlgorithm() const
Get the current algorithm instance.
void setAlgorithm(const QString &algorithmId) override
Set the tiling algorithm.
AutotileEngine(PhosphorZones::LayoutRegistry *layoutManager, PhosphorEngine::IWindowTrackingService *windowTracker, PhosphorScreens::ScreenManager *screenManager, PhosphorTiles::ITileAlgorithmRegistry *algorithmRegistry, QObject *parent=nullptr)
void renumberDesktopsAfterRemoval(int removedDesktop) override
Shift every per-(screen, desktop, activity) state ABOVE removedDesktop down by one,...
QString dragInsertPreviewPriorScreenId() const override
The screen the previewed window sat on before begin adopted it.
Definition AutotileEngine.h:1309
void cancelDragInsertPreview(bool dragStillActive=false) override
Cancel the active drag-insert preview, restoring the original order.
void setAutotileScreens(const QSet< QString > &screens)
Set which screens use autotile (derived from layout assignments).
void setScrollingModeResolver(std::function< bool(const QString &screenId, int desktop, const QString &activity)> resolver)
INERT, kept for ABI: a scrolling-mode resolver that fed windowOpened's cross-screen tile-restore defe...
Definition AutotileEngine.h:631
void requestPostRetileFocus(const QString &screenId, const QString &windowId)
Request that a window is activated after the given screen's next applyTiling.
void demoteFromMaster(const QString &windowId)
Demote a window from the master area.
void setPersistenceDelegate(std::function< void()> saveFn, std::function< void()> loadFn)
Set persistence callbacks for save/load.
Definition AutotileEngine.h:497
void swapFocusedWithMaster() override
Swap the currently focused window with the master window.
QVariantMap perScreenOverrides(const QString &screenId) const override
qreal effectiveSplitRatioStep(const QString &screenId) const override
void setContextGapProvider(std::function< QVariantMap(const QString &screenId)> provider)
void handoffRelease(const QString &windowId) override
Release ownership of a window WITHOUT modifying its geometry.
void restoreFocusedWindow(const PhosphorEngine::NavigationContext &ctx) override
Restore the focused window out of its managed state.
QStringList allFloatingWindows() const
All windows currently floating in autotile across every tracked state.
void focusInDirection(const QString &direction, const PhosphorEngine::NavigationContext &ctx) override
Move keyboard focus to the adjacent window.
int stickyPinnedDesktopForScreen(const QString &screenId) const override
The desktop this engine has pinned this screen to, or 0.
Definition AutotileEngine.h:239
void clearCurrentDesktopForScreen(const QString &screenId) override
Drop a screen's per-output desktop, reverting it to m_context's global desktop.
void notifyAlgorithmWindowAdded(PhosphorTiles::TilingState *state, const QString &screenId, const QString &windowId)
Run the algorithm's onWindowAdded lifecycle hook for a just-inserted window.
PhosphorTiles::TilingAlgorithm * effectiveAlgorithm(const QString &screenId) const
const QString & currentActivity() const noexcept
Get the current activity tracked by the engine.
Definition AutotileEngine.h:409
void noteSplitRatioUserTuned(const QString &screenId)
int effectiveMaxWindows(const QString &screenId) const
LayoutSupport layoutSupport() const override
Autotile algorithms appear as cards in the layout picker / quick slots, so this engine is a placement...
Definition AutotileEngine.h:560
void onWindowResized(const QString &rawWindowId, const QRect &oldFrame, const QRect &newFrame, const QString &screenId) override
Reflow neighbors after a window was interactively resized.
void retile(const QString &screenId=QString()) override
Force retiling of windows.
std::optional< PhosphorEngine::WindowPlacement > capturePlacementForKey(const QString &windowId, const PhosphorEngine::TilingStateKey &key) const
capturePlacement against ONE of the window's contexts rather than its primary.
bool isModeSpecificFloated(const QString &windowId) const override
Definition AutotileEngine.h:243
void rotateWindows(bool clockwise, const PhosphorEngine::NavigationContext &ctx) override
Rotate all managed windows on the screen.
QString engineId() const override
Stable engine identity for HandoffContext.fromEngineId.
Definition AutotileEngine.h:565
void setContextModeResolver(ContextTilesResolver resolver)
Definition AutotileEngine.h:623
void setWindowRegistry(QObject *registry) override
Wire up the shared WindowRegistry.
void reapplyManagedWindowAppearance() override
Re-drive the compositor's per-window appearance (border, hidden title bar) for every window this engi...
void clearAutotileFloated(const QString &rawWindowId)
QRect lastManagedRect(const QString &rawWindowId) const override
The tile rect this engine last emitted for rawWindowId via applyTiling, remembered PAST the window's ...
bool readoptParked(const QString &windowId, const QString &parkedPhysicalId, const QString &returnedPhysicalId) override
Re-seat windowId's contexts parked under parkedPhysicalId on returnedPhysicalId as a re-statement (no...
bool claimCrossScreenReopen(const QString &windowId, const QString &openingScreenId, int minWidth, int minHeight) override
The reopen claim (see IPlacementEngine for the contract): only a FIFO record on another virtual scree...
void setFocusedWindow(const QString &windowId)
Notify the engine that a window has been focused.
QString screenForTrackedWindow(const QString &windowId) const override
Return the screen this engine considers the window to be on (any context), or empty if the window isn...
Definition AutotileEngine.h:571
const QSet< QString > & autotileScreens() const
Get the set of screens currently using autotile.
Definition AutotileEngine.h:268
void unfloatWindow(const QString &windowId)
Unfloat a specific window by its ID (convenience forwarder).
::PhosphorLayout::EdgeGaps effectiveOuterGaps(const QString &screenId) const
void windowClosed(const QString &windowId) override
Notify the engine that a window was closed.
void markModeSpecificFloated(const QString &windowId) override
Definition AutotileEngine.h:259
QString heldScreenForWindow(const QString &windowId) const override
OPTIONAL: the screen this engine genuinely HOLDS the window on IN THE SCREEN'S CURRENT CONTEXT — a ME...
void enabledChanged(bool enabled)
Emitted when the enabled state changes.
bool isAutotileScreen(const QString &screenId) const
Check if a specific screen uses autotile.
void setActiveScreenHint(const QString &screenId) override
Set the active screen hint for keyboard shortcut handlers.
bool isEnabled() const noexcept override
Check if any screen has autotile enabled.
std::optional< int > savedMaxWindowsForAlgorithm(const QString &algorithmId) const override
The user's saved per-algorithm max-windows tuning, if any.
friend class PerScreenConfigResolver
Definition AutotileEngine.h:77
QSize windowMinimumSize(const QString &windowId) const override
The window's client-reported minimum size as last known by this engine, or an UNKNOWN answer when it ...
void updateDragInsertPreview(int insertIndex)
Update the target insert index for the active drag preview.
std::function< bool(const QString &screenId, int desktop, const QString &activity)> ContextTilesResolver
Whether a (screenId, desktop, activity) context tiles, as the daemon resolves it (feature switch,...
Definition AutotileEngine.h:622
bool beginDragInsertPreview(const QString &rawWindowId, const QString &screenId) override
Begin a drag-insert preview on screenId, ADOPTING the window when necessary.
void updateDragInsertPreview(const DragInsertTarget &target) override
IPlacementEngine drop-target form: primary is the tiled-only insert index; secondary/newSlot are mean...
int runtimeMaxWindows() const override
Runtime max-windows limit.
std::optional< PhosphorEngine::WindowPlacement > capturePlacement(const QString &windowId) const override
Report windowId's CURRENT placement for persistence, or nullopt if this engine does not manage it.
void handoffReceive(const HandoffContext &ctx) override
Receive ownership of a window from another engine.
void clearPendingInitialOrder(const QString &screenId)
Drop a screen's initial-order seed: the order, its generation counter and its strict marker,...
QString effectiveAlgorithmId(const QString &screenId) const
QString activeScreen() const override
Get the last-focused screen (updated by onWindowFocused).
Definition AutotileEngine.h:277
bool hasParked(const QString &windowId, const QString &physicalScreenId) const override
Whether windowId has a context parked under physicalScreenId (any output when it is empty).
void swapFocusedInDirection(const QString &direction, const QString &action=QStringLiteral("move"))
Swap the focused window with the adjacent window in tiling order.
void setCurrentActivity(const QString &activity) override
Set the current activity for per-activity tiling state.
void pruneStatesForDesktop(int removedDesktop) override
Prune every TilingState of removedDesktop, releasing its windows.
int computeDragInsertIndexAtPoint(const QString &screenId, const QPoint &cursorPos) const
Compute the insert index for a cursor position on an autotile screen.
Handles navigation, focus cycling, and ratio/count adjustments.
Definition NavigationController.h:34
Resolves per-screen configuration overrides for autotiling.
Definition PerScreenConfigResolver.h:41
Abstract contract for a tiling-algorithm registry.
Definition ITileAlgorithmRegistry.h:41
Abstract base class for tiling algorithms.
Definition TilingAlgorithm.h:54
Tracks tiling state for a single screen.
Definition TilingState.h:40
Manual zone-layout registry + per-context assignment store.
Definition LayoutRegistry.h:87
Represents a collection of zones that form a layout.
Definition Layout.h:42
Definition DesktopRemap.h:12
PlacementStateKey TilingStateKey
Backwards-compatible spelling for autotile's existing sources.
Definition EngineTypes.h:60
StickyPinPhase
Which half of the sticky-screen pin pass to run.
Definition EngineTypes.h:323
std::function< bool(const QString &)> StickyPredicate
Answers whether a window is on all desktops.
Definition EngineTypes.h:247
std::function< DesktopSpan(const QString &)> DesktopSpanQuery
Answers a window's DesktopSpan.
Definition EngineTypes.h:292
Definition IWindowTrackingService.h:28
Definition AutotileConfig.h:13
Definition AutotileEngine.h:52
AutotileInsertPosition
Definition AutotileConstants.h:207
Definition IWindowTrackingService.h:24
The contexts a window occupies, as the per-desktop membership pass reads them: which desktops (x11 nu...
Definition EngineTypes.h:258
Where a drag-insert preview should place the dragged window, in the TARGET ENGINE's slot vocabulary.
Definition IPlacementEngine.h:538
Context for a cross-engine window handoff.
Definition IPlacementEngine.h:863
What a membership pass did, so the caller can drive the bookkeeping the engines cannot reach: the pla...
Definition EngineTypes.h:299
Target window + screen for a navigation or lifecycle operation.
Definition NavigationContext.h:18
Identity of a per-screen placement state: a window's placement is scoped to the (screen,...
Definition EngineTypes.h:25
static QLatin1String autotileEngineId()
Definition WindowPlacement.h:271
Per-side edge gap values (resolved, non-negative pixel values).
Definition EdgeGaps.h:27
Configuration for autotiling behavior.
Definition AutotileConfig.h:82