6#include "phosphorsnapengine_export.h"
51struct SnapEvacueePark;
52struct SnapPendingCarries;
75 QObject* parent =
nullptr);
115 int targetDesktop)
const;
142 void windowOpened(const QString& windowId, const QString& screenId,
int minWidth,
int minHeight) override;
169 m_shouldRestorePredicate = std::move(predicate);
195 m_restorePositionPredicate = std::move(predicate);
227 m_managedRestorePredicate = std::move(predicate);
237 m_liveModeResolver = std::move(resolver);
247 m_contextModeResolver = std::move(resolver);
256 m_tilingEngineLiveResolver = std::move(resolver);
270 using FloatPredicate = std::function<bool(
const QString& windowId,
const QString& screenId)>;
274 m_floatPredicate = std::move(predicate);
296 m_unfloatFallbackPredicate = std::move(predicate);
329 m_placementZonesResolver = std::move(resolver);
342 std::optional<PhosphorEngine::PlacementStateKey>
heldKeyForWindow(
const QString& windowId)
const override;
368 QStringList
parkOutput(
const QString& physicalScreenId)
override;
369 bool readoptParked(
const QString& windowId,
const QString& parkedPhysicalId,
370 const QString& returnedPhysicalId)
override;
371 void dropParked(
const QString& windowId,
const QString& physicalScreenId,
int desktop,
372 const QString& activity)
override;
373 bool hasParked(
const QString& windowId,
const QString& physicalScreenId)
const override;
375 void windowFocused(
const QString& windowId,
const QString& screenId)
override;
377 void setWindowFloat(
const QString& windowId,
bool shouldFloat,
const QString& screenId = QString())
override;
391 return QStringLiteral(
"snap");
444 QVector<PhosphorEngine::ZoneAssignmentEntry>
446 const QStringList& preClaimedZoneIds = {});
608 void renameScreen(
const QString& oldPhysicalId,
const QString& newPhysicalId);
640 const QString& screenId,
int restoreDesktop,
const QString& activity);
768 std::optional<PhosphorEngine::WindowPlacement>
capturePlacement(
const QString& windowId)
const override;
781 int gateDesktop)
const;
828 void commitSnap(
const QString& windowId,
const QString& zoneId,
const QString& screenId,
830 int virtualDesktop = 0);
834 int virtualDesktop = 0);
849 void commitUserSnap(
const QString& windowId,
const QStringList& zoneIds,
const QString& screenId,
850 const QRect& geometry,
const QString& captureScreen,
int virtualDesktop = 0);
860 bool confineToFallbackScreen)
const;
874 const QString& fallbackScreen)
const;
879 std::function<QString()> fallbackScreenResolver = {});
887 bool isSticky)
const;
891 bool isSticky)
const;
893 bool isSticky)
const;
900 QVector<PhosphorEngine::ZoneAssignmentEntry>
902 const QSet<QString>& onlyWindows = {})
const;
903 QVector<PhosphorEngine::ZoneAssignmentEntry>
905 const QStringList& preClaimedZoneIds = {})
const;
907 const QString& screenId)
const;
909 const QString& screenFilter = QString())
const;
954 m_saveFn = std::move(saveFn);
955 m_loadFn = std::move(loadFn);
964 return m_lastActiveScreenId;
987 std::function<std::optional<PhosphorRules::WindowQuery>(
const QString& windowId,
const QString& screenHint)>;
994 m_exclusionQueryProvider = std::move(provider);
1003 m_exclusionAdmission = std::move(admission);
1041 const QString& screenId,
bool sizeOnly);
1055 const QString& zoneId,
const QString& screenId);
1062 void restoreFreeSizeForUnplaced(
const QString& windowId,
const QString& screenId,
int desktop,
1065 QList<QSize> managedSizesOnScreen(
const QString& screenId,
int desktop)
const;
1070 int routedOpenDesktop(
const QString& windowId,
const QString& screenId)
const;
1076 QString canonicalWindowId(
const QString& rawWindowId)
const;
1083 return m_context.currentKeyForScreen(screenId);
1099 void forEachSnapAssignment(
1100 const std::function<
void(
const QString& windowId,
const QStringList& zoneIds,
const QString& screenId,
1101 int desktop,
int storeDesktop,
const QString& storeActivity)>& fn)
const;
1104 bool snappingSwitchedOff()
const;
1110 const QString& restoreScreen)
const;
1113 struct PendingMembership;
1114 void collectMembershipWork(
const QString& windowId,
const QString& screenId,
1125 const QList<PendingMembership>& pending,
1126 const QString& onlyWindow,
1136 void dropPreFloatHome(
SnapState* state,
const QString& windowId);
1143 bool clearGlobalLastUsedIfRemoved(
const QStringList& removed);
1150 const SnapState* lastUsedStateForScreen(
const QString& screenId)
const;
1152 void commitSnapImpl(
const QString& windowId,
const QStringList& zoneIds,
const QString& screenId,
1159 QString resolveUnfloatScreen(
const QString& primaryScreen,
const QString& fallbackScreen)
const;
1180 QPointer<QObject> m_autotileEngineObj;
1186 QPointer<QObject> m_zoneAdjacencyResolverObj;
1195 QPointer<QObject> m_navStateObj;
1197 std::unique_ptr<SnapNavigationTargetResolver> m_targetResolver;
1209 enum class UnfloatCause {
1219 bool unfloatToZone(
const QString& windowId,
const QString& screenId, UnfloatCause cause);
1220 bool applyGeometryForFloat(
const QString& windowId,
const QString& screenId);
1225 void applyFloatGeometryUnlessMinimized(
const QString& windowId,
const QString& screenId);
1230 SnapNavigationTargetResolver* ensureTargetResolver(
const QString& action = QString());
1239 bool tryCrossDesktopMove(
const QString& windowId,
const QString& direction,
const QString& screenId);
1244 bool tryCrossModeOutput(
const QString& windowId,
const QString& direction,
const QString& screenId,
bool swap);
1246 bool isTilingOutput(
const QString& screenId)
const;
1248 bool tryCrossModeFocus(
const QString& direction,
const QString& screenId);
1251 void moveUnsnapped(
const QString& windowId,
const QString& fromScreen,
const QString& toScreen,
int toDesktop,
1252 const QString& direction);
1258 bool tryCrossDesktopFocus(
const QString& focusedWindowId,
const QString& direction,
const QString& screenId);
1263 bool isWindowExcludedForAction(
const QString& windowId,
const QString& action,
const QString& screenId);
1265 bool isWindowExcludedAt(
const QString& windowId,
const QString& screenHint,
int desktop)
const;
1272 QStringList windowsInZoneInView(
const QString& zoneId,
const QString& screenId,
1273 const QString& excludeWindowId)
const;
1302 mutable std::optional<PhosphorRules::RuleEvaluator> m_excludeEvaluator;
1307 ExclusionQueryProvider m_exclusionQueryProvider{};
1310 std::function<void()> m_saveFn;
1311 std::function<void()> m_loadFn;
1314 QString m_lastActiveScreenId;
1320 ShouldRestorePredicate m_shouldRestorePredicate{};
1324 RestorePositionPredicate m_restorePositionPredicate{};
1325 ManagedRestorePredicate m_managedRestorePredicate{};
1326 LiveModeResolver m_liveModeResolver{};
1327 TilingEngineLiveResolver m_tilingEngineLiveResolver{};
1328 FloatPredicate m_floatPredicate{};
1329 UnfloatFallbackPredicate m_unfloatFallbackPredicate{};
1330 PlacementZonesResolver m_placementZonesResolver{};
1333 std::unique_ptr<SnapEvacueePark> m_evacueePark;
1334 ExclusionAdmission m_exclusionAdmission{};
1335 std::unique_ptr<SnapPendingCarries> m_pendingCarries;
1336 ContextModeResolver m_contextModeResolver{};
1342 QSet<QString> m_enteredActivities;
How KWin's desktop positions moved in one change of its desktop list: for each 1-based position in th...
Definition DesktopRemap.h:29
Resolves the neighbouring surface — output or virtual desktop — in a direction, for cross-surface win...
Definition ICrossSurfaceResolver.h:21
Unified placement engine interface, implemented by all three engines (snap zone layouts,...
Definition IPlacementEngine.h:44
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
IPlacementEngine()=default
Per-screen placement state contract.
Definition IPlacementState.h:28
Definition ISnapSettings.h:12
Definition IVirtualDesktopManager.h:13
Definition IWindowRegistry.h:49
Definition IWindowTrackingService.h:35
Exported because this is a header-only template used from every engine library, so the category has t...
Definition PerScreenStates.h:45
Abstract base class for placement engines.
Definition PlacementEngineBase.h:36
Tracks the "current context" of each screen for a placement engine: the global current virtual deskto...
Definition ScreenContextTracker.h:49
An ordered collection of Rules — the persistent rule store.
Definition RuleSet.h:33
Narrow read-only interface for compositor-layer state queries.
Definition INavigationStateProvider.h:32
Narrow interface for zone-adjacency queries used by snap navigation.
Definition IZoneAdjacencyResolver.h:32
void setWindowFloat(const QString &windowId, bool shouldFloat, const QString &screenId=QString()) override
Set floating state explicitly (directional, not toggle).
void windowSnapStateChanged(const QString &windowId, const PhosphorProtocol::WindowStateEntry &entry)
Snap state changed (commit / uncommit). WTA relays to D-Bus windowStateChanged.
void snapAllWindowsRequested(const QString &screenId)
Request KWin effect to collect unsnapped windows and snap them all.
ResnapFeedback
Whether a resnap that finds nothing says so (no_windows_to_resnap): a user verb does,...
Definition SnapEngine.h:407
void focusInDirection(const QString &direction, const PhosphorEngine::NavigationContext &ctx) override
Walk to the adjacent window in direction and transfer keyboard focus; at the layout edge,...
QString entryZoneForCrossing(const QString &direction, const QString &neighbourScreen) const
The zone a window ENTERS crossing onto neighbourScreen in direction: the edge zone facing back toward...
void rekeyMembershipsToRecordedScreens(const QString &physicalScreenId)
After a split or un-split of physicalScreenId rewrote the stores' screen values, re-file each members...
std::function< std::optional< PhosphorRules::WindowQuery >(const QString &windowId, const QString &screenHint)> ExclusionQueryProvider
Provider that builds the full WindowQuery for a live windowId.
Definition SnapEngine.h:986
void renumberDesktopsAfterRemoval(int removedDesktop) override
Shift every per-(screen, desktop, activity) state ABOVE removedDesktop down by one,...
void setPersistenceDelegate(std::function< void()> saveFn, std::function< void()> loadFn)
Set persistence callbacks for save/load.
Definition SnapEngine.h:952
std::function< bool(const QString &windowId)> ManagedRestorePredicate
Predicate consulted in resolveWindowRestore to decide whether a window that was SNAPPED at logout sho...
Definition SnapEngine.h:221
std::function< bool(const QString &screenId, int desktop)> ShouldRestorePredicate
Predicate deciding whether snapping may place a window on (screenId, desktop), so nothing is placed i...
Definition SnapEngine.h:159
QVector< PhosphorEngine::ZoneAssignmentEntry > calculateRotation(bool clockwise, const QString &screenFilter=QString()) const
PhosphorEngine::SnapResult resolveWindowRestore(const QString &windowId, const QString &screenId, bool sticky, PhosphorEngine::WindowKind kind=PhosphorEngine::WindowKind::Unknown, PhosphorEngine::RestoreReason reason=PhosphorEngine::RestoreReason::Open)
Resolve auto-snap for a newly opened window.
void setRestorePositionPredicate(RestorePositionPredicate predicate)
Inject the unsnapped-position-restore gate (see RestorePositionPredicate).
Definition SnapEngine.h:193
void resnapCurrentAssignments(const QString &screenFilter=QString(), const QSet< QString > &onlyWindows={})
Re-apply the zones windows hold, on screenFilter (all when empty), only onlyWindows when it is not em...
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 setExclusionQueryProvider(ExclusionQueryProvider provider)
Inject the exclusion query provider.
Definition SnapEngine.h:992
bool isFloating(const QString &windowId) const
void setManagedRestorePredicate(ManagedRestorePredicate predicate)
Inject the managed (snapped-to-zone) restore gate (see ManagedRestorePredicate).
Definition SnapEngine.h:225
void emitBatchedResnap(const QVector< PhosphorEngine::ZoneAssignmentEntry > &entries)
Emit a single batched resnapToNewLayoutRequested signal.
void setUnfloatFallbackPredicate(UnfloatFallbackPredicate predicate)
Definition SnapEngine.h:294
void setCurrentDesktop(int desktop) override
QSet< int > desktopsWithActiveState() const override
PhosphorEngine::SnapResult calculateSnapToLastZone(const QString &windowId, const QString &windowScreenId, bool isSticky) const
int pruneStaleWindows(const QSet< QString > &aliveWindowIds) override
Drops the state-index membership of every window not in the (canonical) alive set.
bool isAppIdExcluded(const QString &appId) const
True if appId matches an enabled rule of the borrowed exclusion set (Exclude or ExcludePlacement) on ...
PhosphorEngine::MembershipReconcileResult reconcileWindowMemberships(const QString &windowId, const PhosphorEngine::DesktopSpanQuery &spanOf) override
The same pass for ONE window, on the screen it is held on.
void installContextResolver()
Point the container's primary resolution at currentKeyForScreen.
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 reapplyManagedWindowAppearance() override
Re-emit the zone geometry of every non-floating window snapped in view (the shown desktop's store on ...
void rotateWindowsInLayout(bool clockwise, const QString &screenId)
Rotate snapped windows through the layout's zone order on screenId.
void toggleFocusedFloat(const PhosphorEngine::NavigationContext &ctx) override
Toggle the focused window between snapped and floating.
PhosphorEngine::SnapResult calculateSnapToPlacementRule(const QString &windowId, const QString &screenId, bool isSticky) const
The SnapToZone placement of a matched rule on screenId; the four-argument form takes a resolved direc...
std::function< std::function< bool(const PhosphorRules::Rule &)>(const PhosphorRules::WindowQuery &)> ExclusionAdmission
Builds the rule admission for an exclusion query: a rule naming a field the query left unstamped is s...
Definition SnapEngine.h:999
void setExcludeRuleSet(const PhosphorRules::RuleSet *ruleSet)
Wire the daemon's filtered placement-exclusion rule set (rules carrying an Exclude or ExcludePlacemen...
SnapState * snapState() const
The global-scalar holder (alias of globalState), for callers that only need the last-used-zone / user...
Definition SnapEngine.h:560
std::optional< PhosphorEngine::WindowPlacement > capturePlacementAtDesktop(const QString &windowId, int gateDesktop) const
capturePlacement with the mode gate resolved at an EXPLICIT desktop.
PhosphorEngine::SnapResult calculateSnapToEmptyZone(const QString &windowId, const QString &windowScreenId, bool isSticky) const
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...
void setLiveModeResolver(LiveModeResolver resolver)
Definition SnapEngine.h:235
void setPlacementZonesResolver(PlacementZonesResolver resolver)
Definition SnapEngine.h:327
bool isWindowExcluded(const QString &windowId, const QString &screenHint=QString()) const
Resolve exclusion for a live windowId using the FULL window attributes when the exclusion query provi...
bool wasPlacedByPreviousLineage(const QString &windowId) const
That snapshot, taken before anything can re-bind a slot-bearing record under this uuid.
void reapplyLayout(const PhosphorEngine::NavigationContext &ctx) override
Re-apply the zones the windows on ctx.screenId hold in the context in view.
void setContextModeResolver(ContextModeResolver resolver)
Definition SnapEngine.h:245
bool isActiveOnScreen(const QString &screenId) const override
Whether this engine is active on the given screen.
void pushToEmptyZone(const PhosphorEngine::NavigationContext &ctx) override
Move the focused window to the first empty zone on the screen it acts on.
void restoreFocusedWindow(const PhosphorEngine::NavigationContext &ctx) override
Restore the focused window in a zone to its float-back on its screen and float it; one in no zone is ...
std::function< bool(const QString &windowId, const QString &screenId)> UnfloatFallbackPredicate
Predicate deciding whether an unfloat with NO remembered pre-float zone falls back to a zone anyway (...
Definition SnapEngine.h:292
void recordFreeFrameBeforeUserSnap(const QString &windowId, const QString &screenId)
Record a window's live frame as its float-back, ahead of a user snap the DAEMON drives (keys,...
void windowFloatingClearedForSnap(const QString &windowId, const QString &screenId)
Floating state cleared as part of a commit. WTA relays as windowFloatingChanged(id,...
LayoutSupport layoutSupport() const override
Snap placement is driven by user-selectable zone layouts.
Definition SnapEngine.h:383
void resnapFromAutotileOrder(const QStringList &autotileWindowOrder, const QString &screenId)
No in-tree caller (the SnapAdaptor slot of this name calls calculateResnapEntriesFromAutotileOrder an...
PhosphorEngine::IPlacementState * stateForScreen(const QString &screenId) override
Per-screen state object for the given screen.
PhosphorEngine::MembershipReconcileResult reconcileDesktopMemberships(const QString &screenId, const PhosphorEngine::DesktopSpanQuery &spanOf) override
A window on several desktops holds its own zone on each.
std::pair< QString, QRect > resolveCrossDesktopZone(const QString ¤tZoneId, const QString &screenId, int targetDesktop) const
Resolve the zone on screenId's targetDesktop layout that is positionally equivalent to currentZoneId ...
void handoffReceive(const HandoffContext &ctx) override
Receive ownership of a window from another engine.
void setFloating(const QString &windowId, bool floating)
void setExclusionAdmission(ExclusionAdmission admission)
Definition SnapEngine.h:1001
void setCurrentActivity(const QString &activity) override
void commitUserSnap(const QString &windowId, const QStringList &zoneIds, const QString &screenId, const QRect &geometry, const QString &captureScreen, int virtualDesktop=0)
The tail of every user snap the daemon drives: record the free frame the window leaves (on captureScr...
void snapAllWindows(const QString &screenId)
Request the KWin effect to collect and snap all unsnapped windows.
QVector< PhosphorEngine::ZoneAssignmentEntry > calculateResnapFromCurrentAssignments(const QString &screenFilter=QString(), const QSet< QString > &onlyWindows={}) const
void switchFocusBetweenFloatingAndTiling(const QString &screenId) override
Jump focus between the float layer and the snapped layout (niri's switch-focus-between-floating-and-t...
PhosphorEngine::UnfloatResult resolveFallbackUnfloatGeometry(const QString &windowId, const QString &fallbackScreen) const
Fallback unfloat target for a window with NO pre-float zone (a never-snapped window that defaulted to...
void saveState() override
void setFloatPredicate(FloatPredicate predicate)
Definition SnapEngine.h:272
void setFloatingWithResidence(const QString &windowId, const QString &screenId)
Float windowId in its primary store.
void moveFocusedToPosition(int zoneNumber, const PhosphorEngine::NavigationContext &ctx) override
Move the focused window to the layout zone with zoneNumber (1-based) on the screen the verb acts on (...
QVector< PhosphorEngine::ZoneAssignmentEntry > calculateResnapFromPreviousLayout()
int currentVirtualDesktopForScreen(const QString &screenId) const
This screen's current virtual desktop (Plasma 6.7 per-output virtual desktops, #648).
void handoffRelease(const QString &windowId) override
Per context: keeps a membership on another desktop still in snapping mode (the window stays snapped t...
void moveFocusedInDirection(const QString &direction, const PhosphorEngine::NavigationContext &ctx) override
Move the focused window into the adjacent zone in direction (it stacks with an occupant; swap exchang...
int currentVirtualDesktop() const
Current virtual desktop (1-based; 0 when no virtual-desktop manager is wired) and activity,...
std::function< PlacementDirective(const QString &windowId, const QString &screenId)> PlacementZonesResolver
Resolver yielding the open-placement directive — SnapToZone ordinals and/or zone names,...
Definition SnapEngine.h:325
bool isEnabled() const noexcept override
True when snapping is globally enabled.
std::function< bool(const QString &windowId)> RestorePositionPredicate
Predicate consulted in resolveWindowRestore to decide whether a FLOATED window should have its previo...
Definition SnapEngine.h:189
QString windowInZoneOnScreen(const QString &zoneId, const QString &screenId) const
The window snapped to zoneId on screenId in the context the screen shows, or empty if the zone is uno...
QString engineId() const override
Stable engine identity for HandoffContext.fromEngineId.
Definition SnapEngine.h:389
void windowOpened(const QString &windowId, const QString &screenId, int minWidth, int minHeight) override
A new window appeared on this engine's screen.
SnapState * stateForWindow(const QString &windowId)
The SnapState that owns windowId (via the reverse map), or the global holder when the window is untra...
void spanFocusedInDirection(const QString &direction, const PhosphorEngine::NavigationContext &ctx) override
Grow the focused window's zone span into the adjacent zone(s) in direction, or retract the opposite e...
PhosphorEngine::UnfloatResult resolveUnfloatGeometry(const QString &windowId, const QString &fallbackScreen) const
The ABI-stable signature exported before the confinement parameter.
void applyGeometriesBatch(const PhosphorProtocol::WindowGeometryList &geometries, const QString &action)
Window geometries the effect applies in one go; the engine itself emits only action="rotate".
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...
void setCurrentDesktopForScreen(const QString &screenId, int desktop) override
Set a single screen's current virtual desktop (Plasma 6.7 "switch desktopsindependently for each scre...
void restatementGeometryRequested(const QString &windowId, int x, int y, int width, int height, const QString &zoneId, const QString &screenId)
Re-states a placement the window already has (relayed as PlacementPurpose::Restatement).
PhosphorEngine::MembershipReconcileResult releaseWindowOutsideSpan(const QString &windowId, const QString &screenId, const PhosphorEngine::DesktopSpan &span)
Silently release every membership windowId holds outside where it actually is: one off screenId (in a...
void fullscreenHandBackRequested(const QString &windowId)
a user verb with no apply: end its fullscreen
void pruneStatesForActivities(const QStringList &validActivities) override
void setWindowRegistry(QObject *registry) override
Attach the daemon's shared window registry.
void resnapToNewLayoutRequested(const QString &resnapData)
Batched resnap data, committed by SnapAdaptor's applyEngineResnap relay.
void renameScreen(const QString &oldPhysicalId, const QString &newPhysicalId)
Re-file every membership keyed on monitor oldPhysicalId (its virtual screens too) under the same key ...
std::optional< PhosphorEngine::PlacementStateKey > heldKeyForWindow(const QString &windowId) const override
The key of the store that genuinely holds windowId, in ANY context: membership-grade,...
std::optional< PhosphorEngine::WindowPlacement > capturePlacement(const QString &windowId) const override
Unified placement model — report this window's current snap state (snapped or floated) for persistenc...
void remapDesktops(const PhosphorEngine::DesktopRemap &remap) override
OPTIONAL: KWin's desktop list changed (a removal, an insert or a reorder).
bool isSnapModeScreen(const QString &screenId) const
Whether screenId resolves to SNAPPING mode in its current (desktop, activity) context — the same verd...
void pushFocusedToEmptyZone(const PhosphorEngine::NavigationContext &ctx)
Move the focused window to the first empty zone on the screen it acts on.
void applyNoMatchFloatDefault(const QString &windowId, const QString &screenId, PhosphorEngine::RestoreReason reason, bool placedBefore)
The no-match float-default terminal of resolveWindowRestore for a caller outside it.
std::optional< PhosphorEngine::PlacementStateKey > keyForState(const SnapState *state) const
The key state is filed under; nullopt for the global holder or a foreign store.
void commitMultiZoneSnap(const QString &windowId, const QStringList &zoneIds, const QString &screenId, PhosphorEngine::SnapIntent intent=PhosphorEngine::SnapIntent::UserInitiated, int virtualDesktop=0)
void setTilingEngineLiveResolver(TilingEngineLiveResolver resolver)
Definition SnapEngine.h:254
std::function< PhosphorZones::AssignmentEntry::Mode(const QString &screenId)> LiveModeResolver
The daemon's live mode resolver (its ScreenModeRouter, an unclaimed tiling mode downgraded to Snappin...
Definition SnapEngine.h:234
void resnapCurrentAssignments(const QString &screenFilter, const QSet< QString > &onlyWindows, ResnapFeedback feedback)
PhosphorEngine::UnfloatResult resolveUnfloatGeometry(const QString &windowId, const QString &fallbackScreen, bool confineToFallbackScreen) const
Not-found when the RECORDED (raw) home screen names a different physical monitor than fallbackScreen,...
void setShouldRestorePredicate(ShouldRestorePredicate predicate)
Inject the disabled-context placement gate.
Definition SnapEngine.h:167
QVector< PhosphorEngine::ZoneAssignmentEntry > calculateSnapAllWindowEntries(const QStringList &windowIds, const QString &screenId) const
void windowClosed(const QString &windowId) override
A no-op: snap's close is WindowTrackingService-driven (WTS::windowClosed clears the window's SnapStat...
bool isWindowExcludedByRule(const QString &windowId, const QString &screenHint=QString()) const
isWindowExcluded without the minimum-window-size floor: the Exclude rule set alone,...
void snapAllWindows(const PhosphorEngine::NavigationContext &ctx) override
Snap every unmanaged window on the screen.
QStringList parkOutput(const QString &physicalScreenId) override
Copy every context of physicalScreenId (each of its virtual screens) into the park,...
bool migrateWindowToScreen(const QString &windowId, const QString &newScreenId)
Re-home a tracked window onto the store for newScreenId's current context.
void seedPersistedDesktopZones(const QString &windowId, const PhosphorEngine::EngineSlot &slot, const QString &screenId, int restoreDesktop, const QString &activity)
Re-seed a restored record's other desktops' zones into their stores under activity,...
void rotateWindows(bool clockwise, const PhosphorEngine::NavigationContext &ctx) override
Rotate snapped windows through the layout's zone order, dispatched via IPlacementEngine.
void resnapToNewLayout(ResnapFeedback feedback)
const PhosphorEngine::IPlacementState * stateForScreen(const QString &screenId) const override
void applyGeometryRequested(const QString &windowId, int x, int y, int width, int height, const QString &zoneId, const QString &screenId, bool sizeOnly)
Places the window a user verb is about (relayed as PlacementPurpose::UserVerb).
QString lastActiveScreenId() const
Last screen the engine saw via windowFocused (each activation and each focused-screen report).
Definition SnapEngine.h:962
bool holdsWindowInState(const QString &windowId, const SnapState *state) const
Whether state holds a MEMBERSHIP for windowId, not a leftover from before a re-key (the WTS facade's ...
void releaseWindowOffScreen(const QString &windowId, const QString &keepScreenId) override
Silently release every membership off keepScreenId (every one when it is empty): zone with the last-u...
QStringList floatingWindows() const
void resnapToNewLayout()
Resnap a switch's populated buffer into the new layouts: a window back in the layout it was snapped i...
QString navigationScreenFor(const QString &windowId, const QString &preferredScreen) const
The screen a navigation verb on windowId acts on: its stored screen when snapped, else preferredScree...
bool isWindowTracked(const QString &windowId) const override
Whether some store of this engine holds the window, in any context: snapped, snap-floated,...
void windowFocused(const QString &windowId, const QString &screenId) override
A window gained focus (called when the compositor reports activation).
void loadState() override
PhosphorProtocol::SnapAllResultList calculateSnapAllWindows(const QStringList &windowIds, const QString &screenId)
Calculate snap-all-windows assignments without applying them.
SnapState * stateForWindowOnScreen(const QString &windowId, const QString &screenId, int desktop=0)
Resolve-or-register the state windowId's data belongs in for a write on screenId, and return it.
void cycleFocus(bool forward, const PhosphorEngine::NavigationContext &ctx) override
Cycle keyboard focus forward/backward through the windows stacked in the focused window's zone on its...
void uncommitSnap(const QString &windowId)
QVector< PhosphorEngine::ZoneAssignmentEntry > calculateResnapEntriesFromAutotileOrder(const QStringList &autotileWindowOrder, const QString &screenId, const QStringList &preClaimedZoneIds={})
Calculate resnap entries from autotile order WITHOUT emitting signal.
void commitSnap(const QString &windowId, const QString &zoneId, const QString &screenId, PhosphorEngine::SnapIntent intent=PhosphorEngine::SnapIntent::UserInitiated, int virtualDesktop=0)
virtualDesktop pins the assignment to a specific 1-based desktop; 0 (default) records it on screenId'...
QString zoneForWindow(const QString &windowId) const
The zone of windowId's PRIMARY membership (the store in view when it is a member there,...
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 SnapEngine.h:270
SnapState * globalState() const
The global-scalar holder (last-used-zone + user-snapped classes).
Definition SnapEngine.h:553
QVector< PhosphorEngine::ZoneAssignmentEntry > calculateResnapFromAutotileOrder(const QStringList &autotileWindowOrder, const QString &screenId, const QStringList &preClaimedZoneIds={}) const
void toggleWindowFloat(const QString &windowId, const QString &screenId) override
Toggle between managed and floating.
void pruneStatesForDesktop(int removedDesktop) override
void setAutotileEngine(PhosphorEngine::IPlacementEngine *engine)
Set the autotile engine for screen ownership checks.
std::function< bool(PhosphorZones::AssignmentEntry::Mode mode, const QString &screenId)> TilingEngineLiveResolver
INERT, kept for ABI: nothing reads it since snap no longer defers an open to another engine's reclaim...
Definition SnapEngine.h:252
PhosphorProtocol::WindowGeometryList applyBatchAssignments(const QVector< PhosphorEngine::ZoneAssignmentEntry > &entries, PhosphorEngine::SnapIntent intent=PhosphorEngine::SnapIntent::UserInitiated, std::function< QString()> fallbackScreenResolver={})
void setNavigationStateProvider(INavigationStateProvider *provider)
Wire the typed navigation-state provider.
QString entryZoneForCrossing(const QString &direction, const QString &neighbourScreen, int desktop) const
QList< SnapState * > allSnapStates() const
Every SnapState the engine owns, including the global holder, for whole-store enumerations (occupied ...
PhosphorEngine::SnapResult calculateSnapToPlacementRule(const QString &windowId, const QString &screenId, bool isSticky, const PlacementDirective &directive) const
QString currentActivity() const
void forgetWindow(const QString &windowId)
Drop every membership windowId holds AND its data in each member store (closed / removed): a window o...
void pruneStatesForRemovedScreen(const QString &physicalScreenId) override
Prune per-(screen, desktop, activity) state for a PHYSICALLY REMOVED output (monitor hot-unplug),...
void setZoneAdjacencyResolver(IZoneAdjacencyResolver *resolver)
Set typed zone-adjacency resolver for directional navigation.
const SnapState * stateForWindow(const QString &windowId) const
void setCrossSurfaceResolver(PhosphorEngine::ICrossSurfaceResolver *resolver) override
Inject the cross-surface resolver (neighbour output / desktop lookup), threaded into the navigation t...
void swapFocusedInDirection(const QString &direction, const PhosphorEngine::NavigationContext &ctx) override
Swap the focused window with the window in the adjacent zone in direction, exchanging whole zone sets...
std::function< PhosphorZones::AssignmentEntry::Mode(const QString &, int, const QString &)> ContextModeResolver
The mode the daemon resolves for a (screenId, desktop, activity) context, in view or hidden: readoptP...
Definition SnapEngine.h:243
SnapEngine(PhosphorZones::LayoutRegistry *layoutManager, PhosphorEngine::IWindowTrackingService *windowTracker, PhosphorZones::IZoneDetector *zoneDetector, PhosphorEngine::IVirtualDesktopManager *vdm, QObject *parent=nullptr)
Pure snap-mode navigation target resolver.
Definition snapnavigationtargets.h:118
Per-screen snap placement state.
Definition SnapState.h:36
Abstract interface for zone detection + highlight lifecycle.
Definition IZoneDetector.h:84
Manual zone-layout registry + per-context assignment store.
Definition LayoutRegistry.h:87
Definition DesktopRemap.h:12
SnapIntent
Definition EngineTypes.h:62
@ UserInitiated
Definition EngineTypes.h:63
RestoreReason
Why a snap restore is being resolved.
Definition EngineTypes.h:119
@ Open
a window OPEN: session restore, deferred-routing flush
Definition EngineTypes.h:120
WindowKind
Coarse structural classification of a window, carried on the open and close wire calls and on the pla...
Definition EngineTypes.h:77
@ Unknown
Definition EngineTypes.h:78
std::function< DesktopSpan(const QString &)> DesktopSpanQuery
Answers a window's DesktopSpan.
Definition EngineTypes.h:292
QList< SnapAllResultEntry > SnapAllResultList
Definition NavigationTypes.h:38
QList< WindowGeometryEntry > WindowGeometryList
Definition WindowTypes.h:102
Definition SnapStateResolver.h:16
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
One engine's view of a window: which managed slot it occupies (or that it is floating / unmanaged) in...
Definition WindowPlacement.h:41
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
Definition EngineTypes.h:176
Definition EngineTypes.h:210
One window's single, authoritative placement record — the unit of the unified, engine-agnostic restor...
Definition WindowPlacement.h:96
D-Bus struct for window state: (sssbsasb).
Definition WindowTypes.h:134
The evaluation input — an attribute bag matched against a MatchExpression.
Definition WindowQuery.h:37
What a matched open-placement rule directs for an opening window.
Definition PlacementDirective.h:47
Mode
Per-context engine selection.
Definition AssignmentEntry.h:213