Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorProtocol::WindowGeometryEntry Struct Reference

D-Bus struct for batch geometry entries: (siiiis). More...

#include <PhosphorProtocol/WindowTypes.h>

Public Member Functions

QRect toRect () const
QString validationError () const
 Empty when the entry is safe to consume; a diagnostic otherwise.

Static Public Member Functions

static WindowGeometryEntry fromRect (const QString &id, const QRect &r)
static WindowGeometryEntry fromRect (const QString &id, const QRect &r, const QString &screenId)

Public Attributes

QString windowId
int x = 0
int y = 0
int width = 0
int height = 0
QString screenId
 target VS/physical screen (empty = fall back to geometry resolution)

Detailed Description

D-Bus struct for batch geometry entries: (siiiis).

screenId is the daemon-authoritative target screen for this window after the geometry is applied. The compositor uses it to seed its per-window tracked-screen cache (m_trackedScreenPerWindow) without re-deriving from geometry.center() against m_virtualScreenDefs — eliminating a race during virtual-screen swap/rotate where the cache lags the daemon's authoritative move and a stale interpretation triggers a spurious cross-VS unsnap.

Empty screenId means "no authoritative answer; fall back to geometry- based resolution" (used by the autotile float-restore path which doesn't own snap state).

Member Function Documentation

◆ fromRect() [1/2]

WindowGeometryEntry PhosphorProtocol::WindowGeometryEntry::fromRect ( const QString & id,
const QRect & r )
inlinestatic

◆ fromRect() [2/2]

WindowGeometryEntry PhosphorProtocol::WindowGeometryEntry::fromRect ( const QString & id,
const QRect & r,
const QString & screenId )
inlinestatic

◆ toRect()

QRect PhosphorProtocol::WindowGeometryEntry::toRect ( ) const
inline

◆ validationError()

QString PhosphorProtocol::WindowGeometryEntry::validationError ( ) const
inline

Empty when the entry is safe to consume; a diagnostic otherwise.

Call this BEFORE toRect() or any other arithmetic on the fields. Same contract as TileRequestEntry::validationError(), and it exists for the same reason: the consumer's QRect construction overflows before its own guards can run. Size is NOT checked for positivity here — callers legitimately differ on whether a zero extent means "size-only" or "invalid" — only magnitude, which is the half that is undefined behaviour rather than a policy question.

Member Data Documentation

◆ height

int PhosphorProtocol::WindowGeometryEntry::height = 0

◆ screenId

QString PhosphorProtocol::WindowGeometryEntry::screenId

target VS/physical screen (empty = fall back to geometry resolution)

◆ width

int PhosphorProtocol::WindowGeometryEntry::width = 0

◆ windowId

QString PhosphorProtocol::WindowGeometryEntry::windowId

◆ x

int PhosphorProtocol::WindowGeometryEntry::x = 0

◆ y

int PhosphorProtocol::WindowGeometryEntry::y = 0

The documentation for this struct was generated from the following file: