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

Drag policy — daemon-authoritative decision about how a drag should be handled. More...

#include <phosphor-protocol/include/PhosphorProtocol/DragTypes.h>

Public Member Functions

QString validationError () const
 Returns empty QString if valid, or a human-readable description of the invariant violation.
 
bool operator== (const DragPolicy &) const =default
 Full structural equality.
 

Public Attributes

bool streamDragMoved = false
 effect should send dragMoved D-Bus ticks
 
bool showOverlay = false
 daemon will show zone overlay during this drag
 
bool grabKeyboard = false
 effect should grab keyboard (Escape cancel)
 
bool captureGeometry = false
 effect should capture pre-drag geometry
 
bool immediateFloatOnStart = false
 effect should call handleDragToFloat(immediate) at drag start
 
QString screenId
 screen the drag started/currently is on (virtual-screen-aware)
 
DragBypassReason bypassReason = DragBypassReason::None
 drag routing (None = canonical snap path)
 

Detailed Description

Drag policy — daemon-authoritative decision about how a drag should be handled.

Returned from WindowDragAdaptor::beginDrag at drag start and re-emitted via dragPolicyChanged if the cursor crosses a screen boundary that flips the mode (autotile↔snap). The compositor plugin uses this to decide whether to stream dragMoved, grab keyboard, show an overlay, and whether to apply an immediate float transition for an autotile drag.

Wire: (bbbbbss) — 5 bools + 2 strings

Single source of truth replaces the effect-side m_dragBypassedForAutotile / m_cachedZoneSelectorEnabled cache that went stale after every settings reload.

Member Function Documentation

◆ operator==()

bool PhosphorProtocol::DragPolicy::operator== ( const DragPolicy ) const
default

Full structural equality.

Used by WindowDragAdaptor::updateDragCursor to detect per-screen policy changes during a drag — any field that participates in routing (bypass reason, screen id, the behavior flags) is compared, so future fields are picked up automatically without touching the comparator.

◆ validationError()

QString PhosphorProtocol::DragPolicy::validationError ( ) const

Returns empty QString if valid, or a human-readable description of the invariant violation.

Call at every unmarshal site on the effect side to catch garbled policies before they perturb drag state.

Member Data Documentation

◆ bypassReason

DragBypassReason PhosphorProtocol::DragPolicy::bypassReason = DragBypassReason::None

drag routing (None = canonical snap path)

◆ captureGeometry

bool PhosphorProtocol::DragPolicy::captureGeometry = false

effect should capture pre-drag geometry

◆ grabKeyboard

bool PhosphorProtocol::DragPolicy::grabKeyboard = false

effect should grab keyboard (Escape cancel)

◆ immediateFloatOnStart

bool PhosphorProtocol::DragPolicy::immediateFloatOnStart = false

effect should call handleDragToFloat(immediate) at drag start

◆ screenId

QString PhosphorProtocol::DragPolicy::screenId

screen the drag started/currently is on (virtual-screen-aware)

◆ showOverlay

bool PhosphorProtocol::DragPolicy::showOverlay = false

daemon will show zone overlay during this drag

◆ streamDragMoved

bool PhosphorProtocol::DragPolicy::streamDragMoved = false

effect should send dragMoved D-Bus ticks


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