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

Live drag-insert preview state (drag_preview.cpp). More...

#include <PhosphorScrollEngine/ScrollStashTypes.h>

Public Attributes

QString windowId
QString targetScreenId
PhosphorEngine::PlacementStateKey targetKey
 The context the preview inserted into, captured at begin so the prune paths can tell whether a dying context strands it.
PhosphorEngine::IPlacementEngine::DragInsertTarget lastTarget
 The most recent hit-tested drop target, stored verbatim — nothing structural happens until commit applies it.
FloatRestore carried
 The window's OWN begin-time width/display/height/min-size intents.
int autoScrollDirection = 0
 Which edge band the cursor is in: -1 towards the strip's start (left on a horizontal strip, top on a vertical one), +1 towards its end (right / bottom), 0 neither.
QElapsedTimer autoScrollArmed
 Elapsed timer since the cursor entered the band, used for the configured start delay.
bool contextMoveWarned = false
 One-shot latch for the tick's context-moved diagnostic.
qreal autoScrollResidue = 0.0
 Sub-pixel remainder carried between ticks.
bool autoScrollOwnsTarget = false
 True once the delay has elapsed and the scroll owns the drop target.
bool defensivelyDetached = false
 Set when begin's defensive block took the window out of the TARGET strip despite it having no reverse-map entry (a stale forward state).
FloatRestore defensiveSlot
int targetViewAnchorAtBegin = 0
 The TARGET strip's view (anchor + detach latch) as it stood BEFORE begin's detach take and settle clamp.
bool targetViewDetachedAtBegin = false
bool viewScrolledDuringHold = false
 True once the edge auto-scroll actually moved the view during this hold.
int priorViewAnchorAtBegin = 0
 The PRIOR strip's view for a cross-key drag, captured for the same reason: begin's take shortens that strip too, and the cancel that returns the window home must return its view with it.
bool priorViewDetachedAtBegin = false
bool hadPriorState = false
PhosphorEngine::PlacementStateKey priorKey
bool priorSameKey = false
 Whole-key comparison (screen AND desktop AND activity): a same-screen/different-desktop prior context reads false.
bool priorFloating = false
FloatRestore priorSlot
 The tiled slot at begin time (valid when !priorFloating).
bool hadFloatRestoreEntry = false
 The m_floatRestore entry begin consumed when it silently unfloated the window; re-inserted verbatim on cancel.
FloatRestore floatRestoreEntry
bool wasScrollFloated = false
bool priorFloatHadFocus = false
 Whether the floating window held the state's float-focus memory pair (lastFloatingFocus + floatingHasFocus) at begin time.
QSize clientSize
 The size the daemon reported for the dragged window (setDragInsertClientSize), or empty when it reported none.
QString targetActiveAtBegin
 The window each strip involved called active when the hold began, the target strip's and, for a cross-key drag, the prior strip's.
QString priorActiveAtBegin

Detailed Description

Live drag-insert preview state (drag_preview.cpp).

See the engine's m_dragInsertPreview member for the signal-silence and both-endings announcement contract; hoisted here with FloatRestore, which it embeds.

Member Data Documentation

◆ autoScrollArmed

QElapsedTimer PhosphorScrollEngine::DragInsertPreview::autoScrollArmed

Elapsed timer since the cursor entered the band, used for the configured start delay.

Only meaningful while autoScrollDirection is non-zero.

◆ autoScrollDirection

int PhosphorScrollEngine::DragInsertPreview::autoScrollDirection = 0

Which edge band the cursor is in: -1 towards the strip's start (left on a horizontal strip, top on a vertical one), +1 towards its end (right / bottom), 0 neither.

Also the "armed" flag — 0 means the whole mechanism is idle.

◆ autoScrollOwnsTarget

bool PhosphorScrollEngine::DragInsertPreview::autoScrollOwnsTarget = false

True once the delay has elapsed and the scroll owns the drop target.

Distinct from autoScrollDirection, which is set the moment the cursor enters the band.

◆ autoScrollResidue

qreal PhosphorScrollEngine::DragInsertPreview::autoScrollResidue = 0.0

Sub-pixel remainder carried between ticks.

The view anchor is integer pixels, so without this a speed under one pixel per tick would round to zero forever and the strip would never move.

◆ carried

FloatRestore PhosphorScrollEngine::DragInsertPreview::carried

The window's OWN begin-time width/display/height/min-size intents.

Never refreshed mid-drag: reading them from a transient host column stamped foreign widths across columns in the abandoned live-restructure design.

How much of it commit applies depends on the drop. A NEW-COLUMN drop applies all of it, with one exception: a window that ARRIVES (ScrollEngine::dragDropClientSize) on a screen where "the client decides" opens at the client's own size, so the width, the height and the maximize-to-edges flag give way to what that verdict mints (ScrollEngine::dragDropIntents). A JOIN discards width and display, because the window becomes a tile of a host column that already owns both, and only the height, min-size and windowed-fullscreen intents survive (the height re-stated without taking a tabbed host's extent). That is a property of what a join means rather than an oversight, but the word "applied at commit" read as though the whole struct always made it through.

◆ clientSize

QSize PhosphorScrollEngine::DragInsertPreview::clientSize

The size the daemon reported for the dragged window (setDragInsertClientSize), or empty when it reported none.

The daemon reports one only for a window that was FREE at begin, whose frame is the client's own choice rather than a tile, a zone or the output, so any drop that ARRIVES (ScrollEngine::dragDropClientSize) reads it, whichever engine the window comes from. A reorder of a strip tile never does.

◆ contextMoveWarned

bool PhosphorScrollEngine::DragInsertPreview::contextMoveWarned = false

One-shot latch for the tick's context-moved diagnostic.

The daemon's heartbeat keeps ticking a live preview, and the mismatch persists for the rest of the drag once a context-change handler misses a cancel — without the latch the warning repeats per 16 ms tick and drowns the journal. Dies with the preview, which is the right lifetime.

◆ defensivelyDetached

bool PhosphorScrollEngine::DragInsertPreview::defensivelyDetached = false

Set when begin's defensive block took the window out of the TARGET strip despite it having no reverse-map entry (a stale forward state).

That take is a real structural edit made with hadPriorState false, so cancel's "fresh adoption never touched anything" early return would abandon the window: out of the strip AND untracked, gone from the engine entirely. The slot it held is in defensiveSlot.

◆ defensiveSlot

FloatRestore PhosphorScrollEngine::DragInsertPreview::defensiveSlot

◆ floatRestoreEntry

FloatRestore PhosphorScrollEngine::DragInsertPreview::floatRestoreEntry

◆ hadFloatRestoreEntry

bool PhosphorScrollEngine::DragInsertPreview::hadFloatRestoreEntry = false

The m_floatRestore entry begin consumed when it silently unfloated the window; re-inserted verbatim on cancel.

◆ hadPriorState

bool PhosphorScrollEngine::DragInsertPreview::hadPriorState = false

◆ lastTarget

PhosphorEngine::IPlacementEngine::DragInsertTarget PhosphorScrollEngine::DragInsertPreview::lastTarget

The most recent hit-tested drop target, stored verbatim — nothing structural happens until commit applies it.

◆ priorActiveAtBegin

QString PhosphorScrollEngine::DragInsertPreview::priorActiveAtBegin

◆ priorFloatHadFocus

bool PhosphorScrollEngine::DragInsertPreview::priorFloatHadFocus = false

Whether the floating window held the state's float-focus memory pair (lastFloatingFocus + floatingHasFocus) at begin time.

Captured BEFORE begin's removeFloating, which clears both halves when this window holds them; the cancel float-restore arms re-seed the pair from it, mirroring unfloatWindowInternal's insert-refused arm. Without the capture, cancelling a floating preview permanently deadens the float/tiling focus-switch verbs — the window keeps compositor focus across begin/cancel, so no focus report ever re-learns the pair.

◆ priorFloating

bool PhosphorScrollEngine::DragInsertPreview::priorFloating = false

◆ priorKey

PhosphorEngine::PlacementStateKey PhosphorScrollEngine::DragInsertPreview::priorKey

◆ priorSameKey

bool PhosphorScrollEngine::DragInsertPreview::priorSameKey = false

Whole-key comparison (screen AND desktop AND activity): a same-screen/different-desktop prior context reads false.

◆ priorSlot

FloatRestore PhosphorScrollEngine::DragInsertPreview::priorSlot

The tiled slot at begin time (valid when !priorFloating).

◆ priorViewAnchorAtBegin

int PhosphorScrollEngine::DragInsertPreview::priorViewAnchorAtBegin = 0

The PRIOR strip's view for a cross-key drag, captured for the same reason: begin's take shortens that strip too, and the cancel that returns the window home must return its view with it.

Only meaningful when hadPriorState && !priorSameKey && the prior state existed.

◆ priorViewDetachedAtBegin

bool PhosphorScrollEngine::DragInsertPreview::priorViewDetachedAtBegin = false

◆ targetActiveAtBegin

QString PhosphorScrollEngine::DragInsertPreview::targetActiveAtBegin

The window each strip involved called active when the hold began, the target strip's and, for a cross-key drag, the prior strip's.

A captured view anchor is relative to the active column, and begin's take hands the focus to a neighbour when the dragged window held it, so a cancel makes this window active again before it restores the anchor.

◆ targetKey

PhosphorEngine::PlacementStateKey PhosphorScrollEngine::DragInsertPreview::targetKey

The context the preview inserted into, captured at begin so the prune paths can tell whether a dying context strands it.

◆ targetScreenId

QString PhosphorScrollEngine::DragInsertPreview::targetScreenId

◆ targetViewAnchorAtBegin

int PhosphorScrollEngine::DragInsertPreview::targetViewAnchorAtBegin = 0

The TARGET strip's view (anchor + detach latch) as it stood BEFORE begin's detach take and settle clamp.

An Escape promises an exact restore, and the slot alone does not deliver it: dragPreviewRestoreSlot routes through the structural reanchor, whose policy verdict can leave the view somewhere the user never scrolled it. Restored raw on every cancel arm that hands the window back to the target strip.

◆ targetViewDetachedAtBegin

bool PhosphorScrollEngine::DragInsertPreview::targetViewDetachedAtBegin = false

◆ viewScrolledDuringHold

bool PhosphorScrollEngine::DragInsertPreview::viewScrolledDuringHold = false

True once the edge auto-scroll actually moved the view during this hold.

Gates the cancel-time view restore OFF: the scroll was the user's own deliberate motion, and the shipped contract ("stays where a drag scrolled it") says an Escape keeps it — restoring the captured pair is for the holds where nothing but begin's settle and the restore's policy reanchor moved the view.

◆ wasScrollFloated

bool PhosphorScrollEngine::DragInsertPreview::wasScrollFloated = false

◆ windowId

QString PhosphorScrollEngine::DragInsertPreview::windowId

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