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

Drag outcome — daemon-authoritative decision about what to apply at drag end. More...

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

Public Types

enum  Action : int {
  NoOp = 0 , ApplyFloat = 1 , ApplySnap = 2 , RestoreSize = 3 ,
  CancelSnap = 4 , NotifyDragOutUnsnap = 5
}
 

Public Member Functions

QRect toRect () const
 
QString validationError () const
 Returns empty QString if valid, or a human-readable description of the invariant violation.
 

Public Attributes

int action = NoOp
 
QString windowId
 
QString targetScreenId
 
int x = 0
 
int y = 0
 
int width = 0
 
int height = 0
 
QString zoneId
 populated for ApplySnap
 
bool skipAnimation = false
 
bool requestSnapAssist = false
 true → plugin should show snap-assist window picker
 
EmptyZoneList emptyZones
 candidate zones for snap assist (empty unless requestSnapAssist)
 

Detailed Description

Drag outcome — daemon-authoritative decision about what to apply at drag end.

Returned from WindowDragAdaptor::endDrag. The compositor plugin executes exactly the action specified; no further decisions on the effect side. Wire: (issiiiisbba(...)) — int + 2 strings + 4 ints + string + 2 bools + EmptyZoneList

Member Enumeration Documentation

◆ Action

Enumerator
NoOp 

drag produced no state change (e.g. cancelled with no prior snap)

ApplyFloat 

autotile path: mark window floating at current position

ApplySnap 

snap path: apply snap geometry to a zone

RestoreSize 

drag-out unsnap: restore original size, keep current position

CancelSnap 

snap cancelled via Escape

NotifyDragOutUnsnap 

drag ended without activation trigger on a previously-snapped window

Member Function Documentation

◆ toRect()

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

◆ validationError()

QString PhosphorProtocol::DragOutcome::validationError ( ) const

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

Enforces action enum range and per-action cross-field invariants (ApplySnap requires non-empty zoneId + non- zero size, ApplyFloat/RestoreSize/NotifyDragOutUnsnap require windowId, etc).

Member Data Documentation

◆ action

int PhosphorProtocol::DragOutcome::action = NoOp

◆ emptyZones

EmptyZoneList PhosphorProtocol::DragOutcome::emptyZones

candidate zones for snap assist (empty unless requestSnapAssist)

◆ height

int PhosphorProtocol::DragOutcome::height = 0

◆ requestSnapAssist

bool PhosphorProtocol::DragOutcome::requestSnapAssist = false

true → plugin should show snap-assist window picker

◆ skipAnimation

bool PhosphorProtocol::DragOutcome::skipAnimation = false

◆ targetScreenId

QString PhosphorProtocol::DragOutcome::targetScreenId

◆ width

int PhosphorProtocol::DragOutcome::width = 0

◆ windowId

QString PhosphorProtocol::DragOutcome::windowId

◆ x

int PhosphorProtocol::DragOutcome::x = 0

◆ y

int PhosphorProtocol::DragOutcome::y = 0

◆ zoneId

QString PhosphorProtocol::DragOutcome::zoneId

populated for ApplySnap


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