Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
org.phosphor_works.Placement.ZoneDetection

Zone detection at cursor coordinates, adjacency navigation, zone enumeration, and keyboard modifier state.

Well-known name org.phosphor_works.Placement.ZoneDetection
Source XML org.phosphor_works.Placement.ZoneDetection.xml
Methods 11
Signals 1
Properties 0

Methods

detectZoneAtPosition()

Return the zone UUID at the given screen coordinates, or empty string if none.

Arg Direction Type Description
x in i (int32) Screen X coordinate.
y in i (int32) Screen Y coordinate.
zoneId out s (string) Zone UUID at position, or empty string.

detectMultiZoneAtPosition()

Return zone UUIDs at the given position (for multi-zone snap at overlapping boundaries).

Arg Direction Type Description
x in i (int32) Screen X coordinate.
y in i (int32) Screen Y coordinate.
zoneIds out as (array<string>) Zone UUIDs at position.

getZoneGeometry()

Return zone geometry as a struct (x, y, width, height) for the primary screen.

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

getZoneGeometryForScreen()

Return zone geometry as a struct for a specific screen.

Arg Direction Type Description
zoneId in s (string) Zone UUID.
screenId in s (string) Screen ID (empty = primary screen).
geometry out (iiii) (struct(int32,int32,int32,int32)) Zone geometry struct: (x, y, width, height).

getZonesForScreen()

Return all zone UUIDs on the given screen.

Arg Direction Type Description
screenId in s (string) Screen ID.
zoneIds out as (array<string>) Zone UUIDs on the screen.

getAdjacentZone()

Return the adjacent zone in the given direction.

Arg Direction Type Description
currentZoneId in s (string) Starting zone UUID.
direction in s (string) Direction: left, right, up, down.
screenId in s (string) Screen ID (optional, empty = current screen).
zoneId out s (string) Adjacent zone UUID, or empty string.

getFirstZoneInDirection()

Return the edge zone in the given direction. Used when a window is not yet snapped and the user presses a navigation key: returns the leftmost, rightmost, topmost, or bottommost zone.

Arg Direction Type Description
direction in s (string) Direction: left, right, up, down.
screenId in s (string) Screen ID (optional, empty = current screen).
zoneId out s (string) Edge zone UUID, or empty string.

getZoneByNumber()

Return the zone UUID for a given zone number (1-indexed).

Arg Direction Type Description
zoneNumber in i (int32) Zone number (1-based).
screenId in s (string) Screen ID (optional, empty = current screen).
zoneId out s (string) Zone UUID, or empty string.

getAllZoneGeometries()

Return all zone geometries as a list of named geometry structs, optionally for a specific screen.

Arg Direction Type Description
screenId in s (string) Screen ID (optional, empty = all screens).
geometries out a(siiii) (array<struct(string,int32,int32,int32,int32)>) List of named zone geometry structs: (zoneId, x, y, width, height).

getKeyboardModifiers()

Return the current keyboard modifier state as a Qt::KeyboardModifiers bitmask. Values: 0x02000000=Shift, 0x04000000=Control, 0x08000000=Alt, 0x10000000=Meta.

Arg Direction Type Description
modifiers out i (int32) Modifier bitmask (0 if no modifiers pressed).

detectZoneWithModifiers()

Detect zone at position and return modifier state in a single D-Bus call. Returns zoneId;modifiers (e.g. uuid-here;33554432 for Shift). Empty zone ID if no zone found; modifiers still appended after semicolon.

Arg Direction Type Description
x in i (int32) Screen X coordinate.
y in i (int32) Screen Y coordinate.
result out s (string) String: zoneId;modifiers.

Signals

zoneDetected

Emitted when a zone is detected at a position. It carries the zone's rect on the screen the position was detected on, not on the primary screen.

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