Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
org.plasmazones.WindowTracking

Window-to-zone tracking: snap/unsnap notifications, pre-snap geometry for restore, floating state, zone geometry, auto-snap to last zone, restore to persisted zone, resolution-change handling, and keyboard-navigation feedback.

Well-known name org.plasmazones.WindowTracking
Source XML org.plasmazones.WindowTracking.xml
Methods 55
Signals 12
Properties 0

Methods

<tt>windowSnapped()</tt>

Record that a window was snapped to a zone.

Arg Direction Type Description
windowId in s *(string)* Window identifier.
zoneId in s *(string)* Zone UUID.
screenId in s *(string)* Screen where window was snapped (empty to auto-detect).

<tt>windowSnappedMultiZone()</tt>

Record that a window was snapped to multiple zones.

Arg Direction Type Description
windowId in s *(string)* Window identifier.
zoneIds in as *(array<string>)* List of zone UUIDs (first is primary).
screenId in s *(string)* Screen where window was snapped (empty to auto-detect).

<tt>windowUnsnapped()</tt>

Record that a window was unsnapped.

Arg Direction Type Description
windowId in s *(string)* Window identifier.

<tt>notifyDragOutUnsnap()</tt>

Notify that a snapped window was dragged without the activation trigger. Saves pre-float zone, marks floating, and clears zone assignment so the window does not auto-restore to the zone on close/reopen.

Arg Direction Type Description
windowId in s *(string)* Window ID from the effect.

<tt>windowsSnappedBatch()</tt>

Batch snap confirmations: process multiple windowSnapped/windowUnsnapped in one D-Bus call. Used by the KWin effect after resnap stagger completes. Array of (windowId, zoneId, screenId, isRestore).

Arg Direction Type Description
entries in a(sssb) *(array<struct(string,string,string,bool)>)* Array of snap confirmation structs.

<tt>getZoneForWindow()</tt>

Return the zone UUID a window is snapped to, or empty string.

Arg Direction Type Description
windowId in s *(string)* Window identifier.
zoneId out s *(string)* Zone UUID or empty string.

<tt>getMultiZoneForWindow()</tt>

Return all zone UUIDs a window spans (multi-zone snap).

Arg Direction Type Description
windowId in s *(string)* Window identifier.
zoneIds out as *(array<string>)* Zone UUIDs the window spans.

<tt>getWindowsInZone()</tt>

Return window IDs currently snapped to the given zone.

Arg Direction Type Description
zoneId in s *(string)* Zone UUID.
windowIds out as *(array<string>)* Window IDs snapped to the zone.

<tt>getSnappedWindows()</tt>

Return all window IDs that are snapped to any zone.

Arg Direction Type Description
windowIds out as *(array<string>)* All snapped window IDs.

<tt>pruneStaleWindows()</tt>

Remove zone assignments for windows not in the alive set. Called by KWin effect after daemon ready to clean up stale KConfig entries.

Arg Direction Type Description
aliveWindowIds in as *(array<string>)* Window IDs currently known to KWin.

<tt>getEmptyZones()</tt>

Return typed list of empty zones for Snap Assist continuation. Same format as emptyZones from dragStopped.

Arg Direction Type Description
screenId in s *(string)* Screen identifier (e.g. Dell:U2722D:115107 or Dell:U2722D:115107/vs:0).
emptyZones out a(siiiiiibsssdd) *(array<struct(string,int32,int32,int32,int32,int32,int32,bool,string,string,string,double,double)>)* Array of EmptyZoneEntry structs: (zoneId, x, y, width, height, borderWidth, borderRadius, useCustomColors, highlightColor, inactiveColor, borderColor, activeOpacity, inactiveOpacity).

<tt>getLastUsedZoneId()</tt>

Return the last zone a window was snapped to (for auto-snap).

Arg Direction Type Description
zoneId out s *(string)* Last used zone UUID or empty string.

<tt>storePreTileGeometry()</tt>

Store window geometry before tiling (snap or autotile). If overwrite is false (snap mode), skips if entry exists.

Arg Direction Type Description
windowId in s *(string)* Window identifier.
x in i *(int32)* Window X position.
y in i *(int32)* Window Y position.
width in i *(int32)* Window width.
height in i *(int32)* Window height.
screenId in s *(string)* Screen connector name where window is located (for cross-screen restore).
overwrite in b *(bool)* If false, skip if entry exists (snap). If true, always overwrite (autotile).

<tt>hasPreTileGeometry()</tt>

Return true if pre-tile geometry is stored for the window.

Arg Direction Type Description
windowId in s *(string)* Window identifier.
hasGeometry out b *(bool)* True if pre-tile geometry exists.

<tt>getValidatedPreTileGeometry()</tt>

Return pre-tile geometry (pre-snap or pre-autotile) validated against current screen bounds (adjusts off-screen). Returns found, x, y, width, height.

Arg Direction Type Description
windowId in s *(string)* Window identifier.
found out b *(bool)* True if geometry was found and validated.
x out i *(int32)* X position (if found).
y out i *(int32)* Y position (if found).
width out i *(int32)* Width (if found).
height out i *(int32)* Height (if found).

<tt>clearPreTileGeometry()</tt>

Clear stored pre-tile geometry for a window.

Arg Direction Type Description
windowId in s *(string)* Window identifier.

<tt>setWindowFloating()</tt>

Set whether a window is floating (not snapped).

Arg Direction Type Description
windowId in s *(string)* Window identifier.
floating in b *(bool)* True to float.

<tt>isWindowFloating()</tt>

Return true if the window is floating.

Arg Direction Type Description
windowId in s *(string)* Window identifier.
floating out b *(bool)* True if floating.

<tt>getFloatingWindows()</tt>

Return all window IDs that are floating.

Arg Direction Type Description
windowIds out as *(array<string>)* Floating window IDs.

<tt>windowUnsnappedForFloat()</tt>

Unsnap for float toggle; saves zone for later restore.

Arg Direction Type Description
windowId in s *(string)* Window identifier.

<tt>getPreFloatZone()</tt>

Return the zone to restore to when unfloating (if any).

Arg Direction Type Description
windowId in s *(string)* Window identifier.
found out b *(bool)* True if a pre-float zone was stored.
zoneId out s *(string)* Zone to restore to (if found).

<tt>clearPreFloatZone()</tt>

Clear saved pre-float zone for the window.

Arg Direction Type Description
windowId in s *(string)* Window identifier.

<tt>calculateUnfloatRestore()</tt>

Calculate unfloat restore geometry and zone IDs in one call. Supports multi-zone: combined geometry of all pre-float zones.

Arg Direction Type Description
windowId in s *(string)* Window identifier.
screenId in s *(string)* Screen identifier for geometry calculation (e.g. Dell:U2722D:115107).
result out (bassiiii) *(struct(bool,array<string>,string,int32,int32,int32,int32))* UnfloatRestoreResult: (found, zoneIds, screenName, x, y, width, height).

<tt>getZoneGeometry()</tt>

Return zone geometry for the given zone (primary screen).

Arg Direction Type Description
zoneId in s *(string)* Zone UUID.
geometry out (iiii) *(struct(int32,int32,int32,int32))* ZoneGeometryRect: (x, y, width, height).

<tt>getZoneGeometryForScreen()</tt>

Return zone geometry for the given zone on the given screen.

Arg Direction Type Description
zoneId in s *(string)* Zone UUID.
screenId in s *(string)* Screen identifier (e.g. Dell:U2722D:115107 or Dell:U2722D:115107/vs:0).
geometry out (iiii) *(struct(int32,int32,int32,int32))* ZoneGeometryRect: (x, y, width, height).

<tt>snapToAppRule()</tt>

Snap a window to its app-rule-defined zone (highest priority auto-snap). Returns geometry and shouldSnap.

Arg Direction Type Description
windowId in s *(string)* Window to snap.
windowScreenName in s *(string)* Window's current screen identifier (e.g. Dell:U2722D:115107).
sticky in b *(bool)* True if window is on all desktops.
snapX out i *(int32)* Snap X (if shouldSnap).
snapY out i *(int32)* Snap Y (if shouldSnap).
snapWidth out i *(int32)* Snap width (if shouldSnap).
snapHeight out i *(int32)* Snap height (if shouldSnap).
shouldSnap out b *(bool)* True if an app rule matched and window should be snapped.

<tt>snapToLastZone()</tt>

Compute snap geometry for auto-snap to last used zone. Respects moveNewWindowsToLastZone setting. Returns geometry and shouldSnap.

Arg Direction Type Description
windowId in s *(string)* Window to snap.
windowScreenName in s *(string)* Window's current screen identifier (e.g. Dell:U2722D:115107).
sticky in b *(bool)* True if window is on all desktops.
snapX out i *(int32)* Snap X (if shouldSnap).
snapY out i *(int32)* Snap Y (if shouldSnap).
snapWidth out i *(int32)* Snap width (if shouldSnap).
snapHeight out i *(int32)* Snap height (if shouldSnap).
shouldSnap out b *(bool)* True if caller should apply the geometry.

<tt>snapToEmptyZone()</tt>

Snap window to first empty zone (auto-assign). Only fires if layout has autoAssign enabled.

Arg Direction Type Description
windowId in s *(string)* Window to snap.
windowScreenName in s *(string)* Window's current screen identifier (e.g. Dell:U2722D:115107).
sticky in b *(bool)* True if window is on all desktops.
snapX out i *(int32)* Snap X (if shouldSnap).
snapY out i *(int32)* Snap Y (if shouldSnap).
snapWidth out i *(int32)* Snap width (if shouldSnap).
snapHeight out i *(int32)* Snap height (if shouldSnap).
shouldSnap out b *(bool)* True if auto-assign matched and window should be snapped.

<tt>restoreToPersistedZone()</tt>

Restore window to its persisted zone (remembered from last close or previous session). Returns geometry and shouldRestore.

Arg Direction Type Description
windowId in s *(string)* Window to restore.
screenId in s *(string)* Window's screen identifier (e.g. Dell:U2722D:115107).
sticky in b *(bool)* True if window is on all desktops.
snapX out i *(int32)* Restore X (if shouldRestore).
snapY out i *(int32)* Restore Y (if shouldRestore).
snapWidth out i *(int32)* Restore width (if shouldRestore).
snapHeight out i *(int32)* Restore height (if shouldRestore).
shouldRestore out b *(bool)* True if caller should apply the geometry.

<tt>resolveWindowRestore()</tt>

Run the full 4-level snap-restore fallback chain server-side in one call: appRule → persisted → emptyZone → lastZone. Returns geometry and shouldSnap on first match.

Arg Direction Type Description
windowId in s *(string)* Window to restore.
screenId in s *(string)* Window's current screen identifier (e.g. Dell:U2722D:115107).
sticky in b *(bool)* True if window is on all desktops.
windowKind in i *(int32)* Structural kind of the opening window (0=Unknown, 1=Normal, 2=Transient). The daemon compares this against the kind recorded for the matching PendingRestore entry and refuses to restore when both sides are concrete and disagree. Pass 0 to opt out of the gate (legacy callers).
snapX out i *(int32)* Snap X (if shouldSnap).
snapY out i *(int32)* Snap Y (if shouldSnap).
snapWidth out i *(int32)* Snap width (if shouldSnap).
snapHeight out i *(int32)* Snap height (if shouldSnap).
shouldSnap out b *(bool)* True if any strategy matched and window should be snapped.

<tt>getUpdatedWindowGeometries()</tt>

Return updated window geometries after resolution change.

Arg Direction Type Description
geometries out a(siiii) *(array<struct(string,int32,int32,int32,int32)>)* Array of (windowId, x, y, width, height).

<tt>getPendingRestoreGeometries()</tt>

Pre-computed zone geometries for pending restore entries. The effect caches these for instant window teleport on open (no D-Bus round-trip flash).

Arg Direction Type Description
geometriesJson out s *(string)* JSON object: { appId: {x, y, width, height}, ... }

<tt>reportNavigationFeedback()</tt>

Report keyboard-navigation result from KWin effect; daemon emits navigationFeedback for OSD.

Arg Direction Type Description
success in b *(bool)* True if navigation succeeded.
action in s *(string)* Action name (e.g. move, focus).
reason in s *(string)* Reason string (e.g. no adjacent zone).
sourceZoneId in s *(string)* Source zone ID for OSD highlighting (optional).
targetZoneId in s *(string)* Target zone ID for OSD highlighting (optional).
screenId in s *(string)* Screen identifier where navigation occurred (for OSD placement).

<tt>toggleFloatForWindow()</tt>

Daemon-driven float toggle. KWin calls this with the active window; daemon does the logic and emits applyGeometryRequested.

Arg Direction Type Description
windowId in s *(string)* Window identifier (from KWin).
screenId in s *(string)* Screen where window is located.

<tt>setWindowFloatingForScreen()</tt>

Set a window's floating state explicitly (directional, not toggle). Routes to autotile engine for autotile screens, handles snap mode locally. Used by minimize/unminimize, drag-to-float, and monocle unmaximize.

Arg Direction Type Description
windowId in s *(string)* Window identifier (from KWin).
screenId in s *(string)* Screen where window is located.
floating in b *(bool)* True to float, false to unfloat.

<tt>recordSnapIntent()</tt>

Record whether the last snap was user-initiated (for snap-to-last-zone filtering).

Arg Direction Type Description
windowId in s *(string)* Window identifier.
wasUserInitiated in b *(bool)* True if user performed the snap (drag or shortcut), false if auto-snapped.

<tt>cursorScreenChanged()</tt>

Report that the cursor has moved to a different screen. Called by KWin effect when cursor crosses monitor boundaries.

Arg Direction Type Description
screenId in s *(string)* Screen identifier the cursor is now on (e.g. Dell:U2722D:115107 or Dell:U2722D:115107/vs:0).

<tt>windowClosed()</tt>

Notify daemon that a window was closed (cleanup). The window's structural kind is captured into the PendingRestore entry if one is recorded, so the consume path can refuse to assign that entry to a window of a different kind on reopen.

Arg Direction Type Description
windowId in s *(string)* Window identifier.
windowKind in i *(int32)* Structural kind of the closing window (0=Unknown, 1=Normal, 2=Transient). Recorded on the PendingRestore entry if one is enqueued. Pass 0 to opt out of the gate (legacy callers).

<tt>windowActivated()</tt>

Notify daemon that a window was activated/focused.

Arg Direction Type Description
windowId in s *(string)* Window identifier.
screenId in s *(string)* Screen where window is located.

<tt>setFrameGeometry()</tt>

Push current frame geometry for a window into the daemon's shadow. Called by the compositor plugin on windowFrameGeometryChanged (debounced). Enables daemon-local shortcut handlers (e.g. float toggle) to read fresh geometry without a cross-process round-trip.

Arg Direction Type Description
windowId in s *(string)* Window identifier.
x in i *(int32)*
y in i *(int32)*
width in i *(int32)*
height in i *(int32)*

<tt>resnapToNewLayout()</tt>

Resnap all windows from the previous layout to the current layout. Maps by zone number (1->1, 2->2) with cycling when new layout has fewer zones. Call after switching layouts.

No arguments.

<tt>setWindowSticky()</tt>

Set whether a window is sticky (visible on all virtual desktops).

Arg Direction Type Description
windowId in s *(string)* Window identifier.
sticky in b *(bool)* True if window is on all desktops.

<tt>snapAllWindows()</tt>

Trigger snap-all-windows from daemon shortcut. Emits snapAllWindowsRequested signal for the KWin effect to collect unsnapped windows and assign them to zones.

Arg Direction Type Description
screenId in s *(string)* Screen where cursor is located.

<tt>calculateSnapAllWindows()</tt>

Calculate zone assignments for a list of unsnapped windows. Called by compositor plugin after collecting unsnapped windows on the target screen.

Arg Direction Type Description
windowIds in as *(array<string>)* List of unsnapped window IDs.
screenId in s *(string)* Screen for layout/geometry resolution.
snapResults out a(sssiiii) *(array<struct(string,string,string,int32,int32,int32,int32)>)* Array of (windowId, targetZoneId, sourceZoneId, x, y, width, height).

<tt>getMoveTargetForWindow()</tt>

Daemon-driven move: get target zone and geometry for moving a window in a direction.

Arg Direction Type Description
windowId in s *(string)*
direction in s *(string)*
screenId in s *(string)*
result out (bssiiiiss) *(struct(bool,string,string,int32,int32,int32,int32,string,string))* MoveTargetResult: (success, reason, zoneId, x, y, width, height, sourceZoneId, screenName).

<tt>getFocusTargetForWindow()</tt>

Daemon-driven focus: get window ID to activate in adjacent zone.

Arg Direction Type Description
windowId in s *(string)*
direction in s *(string)*
screenId in s *(string)*
result out (bsssss) *(struct(bool,string,string,string,string,string))* FocusTargetResult: (success, reason, windowIdToActivate, sourceZoneId, targetZoneId, screenName).

<tt>getRestoreForWindow()</tt>

Daemon-driven restore: get pre-snap geometry for restoring a snapped window.

Arg Direction Type Description
windowId in s *(string)*
screenId in s *(string)*
result out (bbiiii) *(struct(bool,bool,int32,int32,int32,int32))* RestoreTargetResult: (success, found, x, y, width, height).

<tt>getCycleTargetForWindow()</tt>

Daemon-driven cycle: get next/prev window in same zone to activate.

Arg Direction Type Description
windowId in s *(string)*
forward in b *(bool)*
screenId in s *(string)*
result out (bssss) *(struct(bool,string,string,string,string))* CycleTargetResult: (success, reason, windowIdToActivate, zoneId, screenName).

<tt>getSwapTargetForWindow()</tt>

Daemon-driven swap: get geometries and zone IDs for swapping with adjacent zone.

Arg Direction Type Description
windowId in s *(string)*
direction in s *(string)*
screenId in s *(string)*
result out (bssiiiissiiiissss) *(struct(bool,string,string,int32,int32,int32,int32,string,string,int32,int32,int32,int32,string,string,string,string))* SwapTargetResult: (success, reason, windowId1, x1, y1, w1, h1, zoneId1, windowId2, x2, y2, w2, h2, zoneId2, screenName, sourceZoneId, targetZoneId).

<tt>getPushTargetForWindow()</tt>

Daemon-driven push: get empty zone and geometry for pushing window.

Arg Direction Type Description
windowId in s *(string)*
screenId in s *(string)*
result out (bssiiiiss) *(struct(bool,string,string,int32,int32,int32,int32,string,string))* MoveTargetResult: (success, reason, zoneId, x, y, width, height, sourceZoneId, screenName).

<tt>getSnapToZoneByNumberTarget()</tt>

Daemon-driven snap: get zone and geometry for snapping to zone by number (1-9).

Arg Direction Type Description
windowId in s *(string)*
zoneNumber in i *(int32)*
screenId in s *(string)*
result out (bssiiiiss) *(struct(bool,string,string,int32,int32,int32,int32,string,string))* MoveTargetResult: (success, reason, zoneId, x, y, width, height, sourceZoneId, screenName).

<tt>moveWindowToZone()</tt>

Convenience: snap a window to a specific zone by ID. Resolves geometry, handles bookkeeping, emits applyGeometryRequested.

Arg Direction Type Description
windowId in s *(string)* Window identifier.
zoneId in s *(string)* Target zone UUID.

<tt>swapWindowsById()</tt>

Convenience: swap two specific windows by their IDs. Resolves geometries, handles bookkeeping for both, emits applyGeometryRequested for each.

Arg Direction Type Description
windowId1 in s *(string)* First window identifier.
windowId2 in s *(string)* Second window identifier.

<tt>getWindowState()</tt>

Get comprehensive state for a single window.

Arg Direction Type Description
windowId in s *(string)* Window identifier.
state out (sssbsasb) *(struct(string,string,string,bool,string,array<string>,bool))* WindowStateEntry: (windowId, zoneId, screenId, isFloating, changeType, zoneIds, isSticky).

<tt>getAllWindowStates()</tt>

Get state for all tracked windows (TUI dashboard).

Arg Direction Type Description
states out a(sssbsasb) *(array<struct(string,string,string,bool,string,array<string>,bool)>)* Array of WindowStateEntry structs.

Signals

<tt>windowZoneChanged</tt>

Emitted when a window's zone assignment changes.

Arg Direction Type Description
windowId out s *(string)* Window identifier.
zoneId out s *(string)* Zone UUID (or empty if unsnapped).

<tt>navigationFeedback</tt>

Emitted when KWin effect reports navigation result via reportNavigationFeedback (for OSD).

Arg Direction Type Description
success out b *(bool)* True if navigation succeeded.
action out s *(string)* Action name (e.g. move, focus).
reason out s *(string)* Reason string (e.g. no adjacent zone).
sourceZoneId out s *(string)* Source zone ID for OSD highlighting.
targetZoneId out s *(string)* Target zone ID for OSD highlighting.
screenId out s *(string)* Screen identifier where navigation occurred (for OSD placement).

<tt>pendingRestoresAvailable</tt>

Emitted when the daemon's layout becomes available and there are pending zone restores. The KWin effect should retry restoring untracked windows when receiving this signal.

No payload.

<tt>reapplyWindowGeometriesRequested</tt>

Emitted after panel geometry has settled so the KWin effect should call getUpdatedWindowGeometries and apply those geometries to snapped windows. Fixes shifted windows after closing the KDE panel editor.

No payload.

<tt>windowFloatingChanged</tt>

Emitted when a window's floating state changes (e.g., when a floating window is drag-snapped). The KWin effect should listen to this to keep its local floating cache in sync.

Arg Direction Type Description
windowId out s *(string)* Window identifier.
isFloating out b *(bool)* New floating state.
screenId out s *(string)* Screen where the window is located.

<tt>applyGeometryRequested</tt>

Daemon requests compositor to apply geometry. zoneId empty = float restore only; zoneId set = apply and call windowSnapped.

Arg Direction Type Description
windowId out s *(string)*
x out i *(int32)*
y out i *(int32)*
width out i *(int32)*
height out i *(int32)*
zoneId out s *(string)*
screenId out s *(string)*
sizeOnly out b *(bool)*

<tt>activateWindowRequested</tt>

Daemon requests KWin to activate (focus) a window. Used by daemon-driven focus/cycle navigation.

Arg Direction Type Description
windowId out s *(string)* Window to activate.

<tt>applyGeometriesBatch</tt>

Daemon requests compositor to apply geometries for a batch of windows.

Arg Direction Type Description
geometries out a(siiiis) *(array<struct(string,int32,int32,int32,int32,string)>)* Array of (windowId, x, y, width, height, screenId). screenId is the daemon-authoritative target screen — compositor uses it to seed its tracked-screen cache without re-deriving from geometry. Empty screenId means no authoritative answer (fall back to geometry-based resolution).
action out s *(string)* Navigation action type (rotate, resnap, snap_all) for feedback.

<tt>raiseWindowsRequested</tt>

Daemon requests KWin to raise windows in order (z-order restoration).

Arg Direction Type Description
windowIds out as *(array<string>)* Ordered list of window IDs (bottom-to-top).

<tt>snapAllWindowsRequested</tt>

Emitted when snap-all-windows shortcut is triggered. KWin effect should collect unsnapped windows and call calculateSnapAllWindows.

Arg Direction Type Description
screenId out s *(string)* Screen to operate on.

<tt>moveSpecificWindowToZoneRequested</tt>

Emitted when a specific window (e.g. from Snap Assist) should be moved to a zone.

Arg Direction Type Description
windowId out s *(string)*
zoneId out s *(string)*
x out i *(int32)*
y out i *(int32)*
width out i *(int32)*
height out i *(int32)*

<tt>windowStateChanged</tt>

Unified window state change stream. Emitted on snap, unsnap, float, unfloat, and screen change events.

Arg Direction Type Description
windowId out s *(string)* Window whose state changed.
state out (sssbsasb) *(struct(string,string,string,bool,string,array<string>,bool))* WindowStateEntry: (windowId, zoneId, screenId, isFloating, changeType, zoneIds, isSticky). changeType: snapped, unsnapped, floated, unfloated, screen_changed.