6#include "phosphorengine_export.h"
67 virtual void windowOpened(
const QString& windowId,
const QString& screenId,
int minWidth = 0,
68 int minHeight = 0) = 0;
82 void windowOpened(
const QString& windowId,
const QString& screenId)
105 Q_UNUSED(openingScreenId)
202 virtual void windowFocused(
const QString& windowId,
const QString& screenId) = 0;
229 virtual void setWindowFloat(
const QString& windowId,
bool shouldFloat,
const QString& screenId = QString()) = 0;
592 Q_UNUSED(dragStillActive)
823 virtual void onWindowResized(
const QString& windowId,
const QRect& oldFrame,
const QRect& newFrame,
824 const QString& screenId)
1098 Q_UNUSED(removedDesktop)
1111 Q_UNUSED(removedDesktop)
1115 Q_UNUSED(validActivities)
1130 Q_UNUSED(physicalScreenId)
1170 return std::nullopt;
1177 virtual void retile(
const QString& screenId = QString())
1261 Q_UNUSED(keepScreenId)
1272 Q_UNUSED(physicalScreenId)
1280 virtual bool readoptParked(
const QString& windowId,
const QString& parkedPhysicalId,
1281 const QString& returnedPhysicalId)
1284 Q_UNUSED(parkedPhysicalId)
1285 Q_UNUSED(returnedPhysicalId)
1290 virtual void dropParked(
const QString& windowId,
const QString& physicalScreenId,
int desktop,
1291 const QString& activity)
1294 Q_UNUSED(physicalScreenId)
1300 virtual bool hasParked(
const QString& windowId,
const QString& physicalScreenId)
const
1303 Q_UNUSED(physicalScreenId)
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
virtual QString activeScreen() const
Definition IPlacementEngine.h:1012
virtual void noteCrossScreenClaimsExhausted(const QString &windowId, bool exhausted)
INERT, kept for ABI: fed the removed cross-screen defer gates.
Definition IPlacementEngine.h:113
virtual QString dragInsertPreviewScreenId() const
Definition IPlacementEngine.h:594
virtual void applyPerScreenConfig(const QString &screenId, const QVariantMap &overrides)
Definition IPlacementEngine.h:473
virtual LayoutSupport layoutSupport() const
Default None: an engine must opt in to being a layout consumer.
Definition IPlacementEngine.h:976
virtual void increaseMasterCount()
Definition IPlacementEngine.h:1214
virtual QString engineId() const
Stable engine identity for HandoffContext.fromEngineId.
Definition IPlacementEngine.h:941
virtual void setAlgorithm(const QString &algorithmId)
Definition IPlacementEngine.h:1004
virtual void dropParked(const QString &windowId, const QString &physicalScreenId, int desktop, const QString &activity)
Forget windowId's parked contexts; an empty physicalScreenId, a desktop of 0 or an empty activity mat...
Definition IPlacementEngine.h:1290
virtual void setWindowFloat(const QString &windowId, bool shouldFloat, const QString &screenId=QString())=0
Set floating state explicitly (directional, not toggle).
void windowOpened(const QString &windowId, const QString &screenId)
Convenience overload — equivalent to windowOpened(id, screen, 0, 0).
Definition IPlacementEngine.h:82
virtual void setCurrentActivity(const QString &activity)
Definition IPlacementEngine.h:1045
virtual QString heldScreenForWindow(const QString &windowId) const
OPTIONAL: the screen this engine genuinely HOLDS the window on IN THE SCREEN'S CURRENT CONTEXT — a ME...
Definition IPlacementEngine.h:139
virtual int runtimeMaxWindows() const
Runtime max-windows limit.
Definition IPlacementEngine.h:1156
virtual void setActiveScreenHint(const QString &screenId)
Definition IPlacementEngine.h:1016
virtual std::optional< int > savedMaxWindowsForAlgorithm(const QString &algorithmId) const
The user's saved per-algorithm max-windows tuning for algorithmId, or std::nullopt when the engine ke...
Definition IPlacementEngine.h:1167
virtual void windowMinSizeUpdated(const QString &windowId, int minWidth, int minHeight)
Update a window's minimum size after the initial windowOpened.
Definition IPlacementEngine.h:807
virtual void setWindowRegistry(QObject *registry)
Attach a window-class registry (QObject carrying WindowRegistry).
Definition IPlacementEngine.h:1198
virtual void onWindowResized(const QString &windowId, const QRect &oldFrame, const QRect &newFrame, const QString &screenId)
Notify the engine that a tracked window finished an interactive resize.
Definition IPlacementEngine.h:823
virtual void setCurrentDesktopForScreen(const QString &screenId, int desktop)
Set a single screen's current virtual desktop (Plasma 6.7 "switch desktopsindependently for each scre...
Definition IPlacementEngine.h:1035
virtual void setActiveScreens(const QSet< QString > &screens)
Definition IPlacementEngine.h:313
virtual bool readoptParked(const QString &windowId, const QString &parkedPhysicalId, const QString &returnedPhysicalId)
Re-seat windowId's contexts parked under parkedPhysicalId on returnedPhysicalId as a re-statement (no...
Definition IPlacementEngine.h:1280
virtual void windowFocused(const QString &windowId, const QString &screenId)=0
A window gained focus (called when the compositor reports activation).
virtual QStringList parkOutput(const QString &physicalScreenId)
Copy every context of physicalScreenId (each of its virtual screens) into the park,...
Definition IPlacementEngine.h:1270
virtual QString screenForTrackedWindow(const QString &windowId) const
Return the screen this engine considers the window to be on (any context), or empty if the window isn...
Definition IPlacementEngine.h:780
virtual bool isWindowTracked(const QString &windowId) const
Definition IPlacementEngine.h:747
virtual void commitDragInsertPreview()
Definition IPlacementEngine.h:579
virtual void spanFocusedInDirection(const QString &direction, const NavigationContext &ctx)
Grow or shrink the focused window's zone span toward the direction: extend into the adjacent zone(s) ...
Definition IPlacementEngine.h:248
virtual bool dragAutoScrollActive() const
Whether edge auto-scroll currently owns the drop target.
Definition IPlacementEngine.h:678
virtual void moveFocusedInDirection(const QString &direction, const NavigationContext &ctx)=0
Move the focused window to the adjacent slot.
virtual void scheduleRetileForScreen(const QString &screenId)
Definition IPlacementEngine.h:1181
virtual void swapFocusedWithMaster()
Definition IPlacementEngine.h:1223
virtual void cancelDragAutoScroll()
Give the drop target back and forget any armed band, WITHOUT moving the view or re-aiming.
Definition IPlacementEngine.h:692
virtual void handoffRelease(const QString &windowId)
Release ownership of a window WITHOUT modifying its geometry.
Definition IPlacementEngine.h:933
virtual bool isWindowTiled(const QString &windowId) const
Whether the window is actively tiled (engine-owned, non-floating).
Definition IPlacementEngine.h:769
virtual ~IPlacementEngine()=default
virtual void setCrossSurfaceResolver(ICrossSurfaceResolver *resolver)
Inject the cross-surface resolver used to find a neighbouring output / desktop when directional navig...
Definition IPlacementEngine.h:1054
virtual void setInitialWindowOrder(const QString &screenId, const QStringList &windowIds)
Definition IPlacementEngine.h:394
virtual void restoreFocusedWindow(const NavigationContext &ctx)=0
Restore the focused window out of its managed state.
virtual void clearCurrentDesktopForScreen(const QString &screenId)
Drop a screen's per-output desktop, reverting it to the global current.
Definition IPlacementEngine.h:1041
virtual IPlacementState * stateForScreen(const QString &screenId)=0
Per-screen state object for the given screen.
virtual void handoffReceive(const HandoffContext &ctx)
Receive ownership of a window from another engine.
Definition IPlacementEngine.h:916
virtual QSize windowMinimumSize(const QString &windowId) const
The window's client-reported minimum size as last known by this engine, or an UNKNOWN answer when it ...
Definition IPlacementEngine.h:796
virtual void focusMaster()
Definition IPlacementEngine.h:1220
virtual QString algorithmId() const
Definition IPlacementEngine.h:1000
virtual void saveState()=0
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
virtual bool dragAutoScrollTick(const QString &screenId, const QPoint &cursorPos, qreal dtSeconds)
Advance edge auto-scroll for a live drag-insert preview (niri's dnd-edge-view-scroll): an engine whos...
Definition IPlacementEngine.h:655
virtual MembershipReconcileResult reconcileWindowMemberships(const QString &windowId, const DesktopSpanQuery &spanOf)
The same pass for ONE window, on the screen it is held on.
Definition IPlacementEngine.h:1085
virtual void setOpenFocusEligible(bool eligible)
OPTIONAL: whether the opens dispatched next may take focus ("Focus newwindows"): true for a genuine o...
Definition IPlacementEngine.h:1249
virtual void cancelDragInsertPreview(bool dragStillActive=false)
dragStillActive: the previewed window is still under an interactive move when the cancel runs (mid-dr...
Definition IPlacementEngine.h:590
virtual bool hasDragInsertPreview() const
Definition IPlacementEngine.h:569
virtual void decreaseMasterRatio(qreal delta=kDefaultSplitRatioStep)
Definition IPlacementEngine.h:1210
virtual void focusInDirection(const QString &direction, const NavigationContext &ctx)=0
Move keyboard focus to the adjacent window.
virtual void windowOpened(const QString &windowId, const QString &screenId, int minWidth=0, int minHeight=0)=0
A new window appeared on this engine's screen.
virtual void beginArrivalBurst()
Bracket a BURST of windowOpened calls delivered together (the adaptor's three dispatch loops: windows...
Definition IPlacementEngine.h:183
virtual void clearModeSpecificFloatMarker(const QString &windowId)
Definition IPlacementEngine.h:508
virtual void moveFocusedToPosition(int position, const NavigationContext &ctx)=0
Move the focused window to the Nth position.
virtual bool providesDragInsertSelector() const
Whether the daemon's edge-triggered drag popup (the zone selector surface) should render this engine'...
Definition IPlacementEngine.h:991
virtual void setDragInsertClientSize(const QSize &size)
OPTIONAL: the size the client chose for the window under the live drag-insert preview,...
Definition IPlacementEngine.h:1331
virtual void refreshConfigFromSettings()
Re-read all tuning values from the engine's settings interface.
Definition IPlacementEngine.h:1142
virtual void pruneStatesForRemovedScreen(const QString &physicalScreenId)
Prune per-(screen, desktop, activity) state for a PHYSICALLY REMOVED output (monitor hot-unplug),...
Definition IPlacementEngine.h:1128
virtual QSet< QString > activeScreens() const
Definition IPlacementEngine.h:309
virtual bool isWindowManaged(const QString &windowId) const
Whether the engine considers the window "managed" (eligible for layout operations).
Definition IPlacementEngine.h:761
virtual void retile(const QString &screenId=QString())
Definition IPlacementEngine.h:1177
virtual const IPlacementState * stateForScreen(const QString &screenId) const =0
virtual QString dragInsertPreviewPriorScreenId() const
The screen the previewed window was on BEFORE begin adopted it, or empty when it had no prior state (...
Definition IPlacementEngine.h:607
LayoutSupport
How this engine relates to user-selectable layouts — the entries the layout picker,...
Definition IPlacementEngine.h:955
@ None
No layout concept at all: the daemon suppresses the picker/popup and answers the layout shortcuts wit...
Definition IPlacementEngine.h:959
virtual bool restorePlacement(const WindowPlacement &placement, const QString &screenId)
Apply placement to a (re)opening window on screenId.
Definition IPlacementEngine.h:378
virtual bool isEnabled() const noexcept
Definition IPlacementEngine.h:1008
virtual qreal effectiveSplitRatioStep(const QString &screenId) const
Definition IPlacementEngine.h:1148
virtual void updateStickyScreenPins(const StickyPredicate &isSticky, StickyPinPhase phase)
Run one phase of the sticky-screen pin pass; see StickyPinPhase for why the two phases bracket a cont...
Definition IPlacementEngine.h:1061
virtual bool isActiveOnScreen(const QString &screenId) const =0
Whether this engine is active on the given screen.
virtual void toggleWindowFloat(const QString &windowId, const QString &screenId)=0
Toggle between managed and floating.
virtual void swapFocusedInDirection(const QString &direction, const NavigationContext &ctx)=0
Swap the focused window with the adjacent window.
virtual void increaseMasterRatio(qreal delta=kDefaultSplitRatioStep)
Definition IPlacementEngine.h:1206
virtual bool isModeSpecificFloated(const QString &windowId) const
Definition IPlacementEngine.h:503
virtual void rotateWindows(bool clockwise, const NavigationContext &ctx)=0
Rotate all managed windows on the screen.
virtual MembershipReconcileResult reconcileDesktopMemberships(const QString &screenId, const DesktopSpanQuery &spanOf)
Give every window whose span covers screenId's current context a place in it, and take back the place...
Definition IPlacementEngine.h:1073
virtual bool beginDragInsertPreview(const QString &windowId, const QString &screenId)
Definition IPlacementEngine.h:573
virtual void snapAllWindows(const NavigationContext &ctx)=0
Bring every unmanaged window on the screen back under this engine's placement (zones for snap,...
virtual void cycleFocus(bool forward, const NavigationContext &ctx)=0
Cycle keyboard focus through managed windows.
virtual void toggleFocusedFloat(const NavigationContext &ctx)=0
Toggle the focused window between managed and floating.
virtual void windowClosed(const QString &windowId)=0
A window was closed.
IPlacementEngine()=default
virtual void clearPerScreenConfig(const QString &screenId)
Definition IPlacementEngine.h:478
virtual void renumberDesktopsAfterRemoval(int removedDesktop)
Shift every per-(screen, desktop, activity) state ABOVE removedDesktop down by one,...
Definition IPlacementEngine.h:1109
IPlacementEngine(const IPlacementEngine &)=delete
virtual void reapplyLayout(const NavigationContext &ctx)=0
Re-apply the current layout to all managed windows.
virtual void reapplyManagedWindowAppearance()
Re-drive the compositor's per-window appearance (border, hidden title bar) for every window this engi...
Definition IPlacementEngine.h:333
virtual void setCurrentDesktop(int desktop)
Definition IPlacementEngine.h:1025
virtual bool hasParked(const QString &windowId, const QString &physicalScreenId) const
Whether windowId has a context parked under physicalScreenId (any output when it is empty).
Definition IPlacementEngine.h:1300
virtual void loadState()=0
virtual std::optional< PlacementStateKey > heldKeyForWindow(const QString &windowId) const
The (screen, desktop, activity) key of the state that genuinely holds windowId, tiled or floating,...
Definition IPlacementEngine.h:166
virtual void pruneStatesForDesktop(int removedDesktop)
Definition IPlacementEngine.h:1096
virtual void pushToEmptyZone(const NavigationContext &ctx)=0
Move the focused window to the first empty slot.
virtual void releaseWindowOffScreen(const QString &windowId, const QString &keepScreenId)
OPTIONAL: another engine just placed windowId on keepScreenId, so a hold this engine keeps on any oth...
Definition IPlacementEngine.h:1258
virtual void remapDesktops(const DesktopRemap &remap)
OPTIONAL: KWin's desktop list changed (a removal, an insert or a reorder).
virtual void markModeSpecificFloated(const QString &windowId)
Definition IPlacementEngine.h:499
virtual void decreaseMasterCount()
Definition IPlacementEngine.h:1217
virtual void setInteractiveDragWindow(const QString &windowId)
The window currently under a compositor interactive move (the whole drag, preview or not).
Definition IPlacementEngine.h:731
virtual void endArrivalBurst()
Definition IPlacementEngine.h:186
virtual bool claimCrossScreenReopen(const QString &windowId, const QString &openingScreenId, int minWidth=0, int minHeight=0)
OPTIONAL: the reopen claim, under the reopen contract (restores happen where a window opens).
Definition IPlacementEngine.h:101
virtual QSet< int > desktopsWithActiveState() const
Definition IPlacementEngine.h:1092
IPlacementEngine & operator=(const IPlacementEngine &)=delete
virtual QRect dragInsertIndicatorRect(const QString &screenId) const
The rect the dragged window would occupy if the live preview were dropped now, in absolute px on scre...
Definition IPlacementEngine.h:711
virtual DragInsertTarget computeDragInsertTargetAtPoint(const QString &screenId, const QPoint &cursorPos) const
Compute the drop target for a cursor position on a managed screen.
Definition IPlacementEngine.h:614
virtual void updateDragInsertPreview(const DragInsertTarget &target)
Update the drop target for an active drag-insert preview.
Definition IPlacementEngine.h:625
virtual QStringList managedWindowOrder(const QString &screenId) const
Definition IPlacementEngine.h:389
virtual int stickyPinnedDesktopForScreen(const QString &screenId) const
The desktop this engine has PINNED screenId to, or 0 when it has not pinned it (which is the normal c...
Definition IPlacementEngine.h:431
virtual QVariantMap perScreenOverrides(const QString &screenId) const
Definition IPlacementEngine.h:482
virtual QString managedFocusedWindow(const QString &screenId) const
The window this engine considers focused on screenId, or empty.
Definition IPlacementEngine.h:407
virtual void setInitialFocusedWindow(const QString &screenId, const QString &windowId)
Hand the incoming engine the focus captured from the outgoing one.
Definition IPlacementEngine.h:452
virtual void pruneStatesForActivities(const QStringList &validActivities)
Definition IPlacementEngine.h:1113
virtual std::optional< WindowPlacement > capturePlacement(const QString &windowId) const
Report windowId's CURRENT placement for persistence, or nullopt if this engine does not manage it.
Definition IPlacementEngine.h:357
virtual void switchFocusBetweenFloatingAndTiling(const QString &screenId)
Jump focus between the float layer and the engine's placement layer (niri's switch-focus-between-floa...
Definition IPlacementEngine.h:266
Per-screen placement state contract.
Definition IPlacementState.h:28
Definition DesktopRemap.h:12
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
Where a drag-insert preview should place the dragged window, in the TARGET ENGINE's slot vocabulary.
Definition IPlacementEngine.h:538
bool newSlot
Definition IPlacementEngine.h:541
int secondary
Definition IPlacementEngine.h:540
bool isValid() const
Definition IPlacementEngine.h:544
int primary
Definition IPlacementEngine.h:539
bool leadingEdge
Definition IPlacementEngine.h:542
bool operator==(const DragInsertTarget &other) const =default
Context for a cross-engine window handoff.
Definition IPlacementEngine.h:863
QString fromEngineId
source engine identity ("snap" / "autotile" / "scrolling" / "")
Definition IPlacementEngine.h:865
bool wasFloating
window was floating in source engine
Definition IPlacementEngine.h:884
QSize minSize
minimum size as the SOURCE engine models it (0x0 when unknown) — autotile stores it screen-capped,...
Definition IPlacementEngine.h:874
int toDesktop
destination virtual desktop (1-based); 0 = current desktop (drag-drop / same-desktop monitor crossing...
Definition IPlacementEngine.h:867
QRect sourceGeometry
window's frame at handoff time (for size preservation)
Definition IPlacementEngine.h:873
QPoint dropPos
cursor position at drop, or invalid for non-drag handoffs
Definition IPlacementEngine.h:872
QString toScreenId
destination screen (must be owned by to engine)
Definition IPlacementEngine.h:866
int insertIndex
PER-TARGET unit.
Definition IPlacementEngine.h:892
bool heldFocus
the window held compositor focus at handoff time, per the daemon's windowActivated tracking.
Definition IPlacementEngine.h:885
QStringList sourceZoneIds
zones the window held at source (empty if not snapped)
Definition IPlacementEngine.h:883
QString windowId
Definition IPlacementEngine.h:864
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
One window's single, authoritative placement record — the unit of the unified, engine-agnostic restor...
Definition WindowPlacement.h:96