|
| | ScrollState (const QString &screenId, QObject *parent=nullptr) |
| ScrollStrip & | strip () |
| const ScrollStrip & | strip () const |
| void | addFloating (const QString &windowId) |
| bool | hasFloating () const |
| | Whether anything floats out of this strip, without building the sorted list floatingWindows() returns — the emptiness question has a caller on the relayout path (applyLayout's empty-strip arm), where allocating and sorting a QStringList to ask it is pure waste.
|
| bool | removeFloating (const QString &windowId) |
| QString | lastFloatingFocus () const |
| | Focus-side memory for switch-focus-between-floating-and-tiling: the float most recently reported focused by the compositor, and whether the float layer holds focus RIGHT NOW.
|
| void | setLastFloatingFocus (const QString &windowId) |
| bool | floatingHasFocus () const |
| void | setFloatingHasFocus (bool hasFocus) |
| bool | hasLastAppliedViewOffset () const |
| | The strip viewOffset carried by the last geometry batch this state actually emitted, and whether it has emitted one at all.
|
| int | lastAppliedViewOffset () const |
| QRect | lastAppliedWorkArea () const |
| StripAxis | lastAppliedAxis () const |
| | The AXIS the baseline was measured along.
|
| bool | hasResolvedAxis () const |
| | The axis this state was last RESOLVED against, which is a different question from lastAppliedAxis above.
|
| StripAxis | resolvedAxis () const |
| void | setResolvedAxis (StripAxis axis) |
| void | setLastAppliedViewOffset (int viewOffset, const QRect &workArea, StripAxis axis) |
| void | clearLastAppliedViewOffset () |
| | Invalidate the baseline entirely: the next emitted batch takes the first-batch path (zero delta, outright placement).
|
| int | blueprintCursor () const |
| | How many entries this strip has taken from the context template's seed blueprint since it was last empty.
|
| void | setBlueprintCursor (int cursor) |
| void | resetBlueprintCursor () |
| QVariant | blueprintIdentity () const |
| | The blueprint value the cursor is counting against.
|
| void | setBlueprintIdentity (const QVariant &blueprint) |
| | Stamps the value AND marks it established — there is deliberately no way to store one without establishing it.
|
| bool | hasBlueprintIdentity () const |
| | Whether an identity has been ESTABLISHED, which is a different question from whether the stored value is null.
|
| QString | screenId () const override |
| | Screen this state object manages.
|
| int | windowCount () const override |
| | Total number of managed windows (tiled + floating).
|
| QStringList | managedWindows () const override |
| | All windows managed by this state (tiled + floating).
|
| bool | containsWindow (const QString &windowId) const override |
| | Whether the window is in this state's managed set.
|
| bool | isFloating (const QString &windowId) const override |
| | Whether the window is floating (excluded from placement).
|
| QStringList | floatingWindows () const override |
| | All currently-floating windows.
|
| QString | placementIdForWindow (const QString &windowId) const override |
| | Opaque slot id: the window's index in strip order, matching the autotile convention (order index as string).
|
| int | tiledWindowCount () const override |
| | Number of tiled (non-floating) windows in the managed set.
|
| virtual | ~IPlacementState ()=default |
| virtual int | masterCount () const |
| | Number of master windows (autotile concept; snap returns 1).
|
Per-(screen, desktop, activity) scrolling state: one ScrollStrip plus the windows floated out of it.
Owned by ScrollEngine via PerScreenStates (Qt-parent-owned), mirroring SnapState / TilingState.
Floating windows are NOT in the strip — a float pulls the window out and its column closes up. An unfloat restores the remembered slot (stack anchor, column index, width and display), falling back to a fresh column next to the focused one only when none of that survives. The engine drives both transitions; this object only stores membership.
| int PhosphorScrollEngine::ScrollState::blueprintCursor |
( |
| ) |
const |
|
inline |
How many entries this strip has taken from the context template's seed blueprint since it was last empty.
The blueprint is a SEED, not a standing rule: entry i describes the i-th column this strip grows, and once consumed it is spent. Deriving the index from the live column count instead made the blueprint refill any gap — closing a column handed its prescription straight back to the next open, so a column the user toggled to Normal came back Tabbed and the toggle read as broken.
Readers take qMax(cursor, columnCount), never the cursor alone. Columns also materialize through paths that consume NOTHING (stash restore, mode-transition seed, unfloat, re-home), and without that floor a restored three-column strip would hand entry 0 to its next open. The floor states the real invariant: entry i is never given to a column when i columns already exist. While a strip only grows the two agree exactly, which is why growing a strip behaves as it always did.
The floor is a lower bound on spent-ness, not a substitute for it: it recovers only as many entries as there are live columns, so a strip that LOST a column before travelling through a non-consuming path comes back under-counted. That is why the cursor rides the strip stash (StashedStrip::blueprintCursor) across a mode round trip rather than being rebuilt from the column count on the far side.
Reset on exactly two events:
- the strip genuinely EMPTIES — no columns, nothing floating, no detached drag window (applyLayout's empty branch, beside clearLastAppliedViewOffset). A screen you cleared out starts its next session from the top of the blueprint. The condition is the STRIP, not the resolve: an all-minimized or mid-drag strip resolves to no columns while still standing for its entries, and resetting there handed them straight back out again.
- the blueprint itself CHANGES, noticed at the consumption site by comparing blueprintIdentity when one has been ESTABLISHED (see hasBlueprintIdentity). Picking a new template is an explicit act, and a cursor describing the old template's entries would swallow the new one's opening columns. Comparing the VALUE rather than reacting to override-map writes is deliberate: the map is dropped and rebuilt on ordinary context changes that leave the template untouched. A state that has no identity yet is NOT a change — it stamps and keeps whatever cursor it was restored with.
| QVariant PhosphorScrollEngine::ScrollState::blueprintIdentity |
( |
| ) |
const |
|
inline |
The blueprint value the cursor is counting against.
The cursor indexes into one particular blueprint, so it is only meaningful beside the blueprint that produced it. Holding the value here lets the consumption site notice a swap by comparing, which is what makes invalidation independent of the override map's lifecycle: dropping and re-pushing the SAME template (every desktop switch away from scrolling and back does exactly that) leaves the cursor standing, while picking a different template restarts it. Keying the reset off the map's writes instead meant a screen that merely left scrolling for a moment came back with a cursor of 0 and refilled entries its columns already stood for.
| void PhosphorScrollEngine::ScrollState::clearLastAppliedViewOffset |
( |
| ) |
|
|
inline |
Invalidate the baseline entirely: the next emitted batch takes the first-batch path (zero delta, outright placement).
Called when the strip EMPTIES — the state object survives an empty period, and a baseline captured before it would describe a slide from a coordinate nothing on screen occupies, flying the repopulating window in from wherever the old view sat.
| bool PhosphorScrollEngine::ScrollState::hasBlueprintIdentity |
( |
| ) |
const |
|
inline |
Whether an identity has been ESTABLISHED, which is a different question from whether the stored value is null.
A null identity is the perfectly ordinary "this context has no template", so it cannot double as the unset marker: a state rebuilt by a mode round trip or a login restore starts with a null value AND a real cursor carried in beside it, and reading that null as "the blueprint changed" reset the very cursor the carry exists to preserve. Not established means the consumption site STAMPS and leaves the cursor alone; established-and-different is the only genuine swap.
| bool PhosphorScrollEngine::ScrollState::hasLastAppliedViewOffset |
( |
| ) |
const |
|
inline |
The strip viewOffset carried by the last geometry batch this state actually emitted, and whether it has emitted one at all.
The difference between this and the next batch's viewOffset is the view DELTA: how far the whole strip slid, as opposed to how far any one window moved. The effect springs that delta once per output and lets every carried window ride it, instead of starting an independent per-window spring each (see the viewDelta field on the tile-request wire).
TRANSIENT — deliberately not serialized. A restored or freshly created state has nothing on screen to slide FROM, so its first batch must carry a zero delta and place windows outright. Living on the state rather than in a parallel per-screen hash means it dies with the context it describes, so no pruning path has to remember it.
Only an EMITTED batch updates it. A relayout suppressed by the emit-on-change gate leaves the compositor showing the previous positions, so the baseline has to keep describing those. The baseline is only meaningful against the work area it was resolved in. Column widths are fractions of that area, so a resolution change, a panel appearing or a gap edit rescales every column's strip position and therefore the view coordinate itself — by an amount proportional to how deep the anchor sits on the strip, which on a long strip is thousands of logical pixels. A delta measured across two different areas describes a slide that never happened, and the effect would fly the whole strip in from off-screen to "recover" from it, once per emitted change while a user drags a gap slider.
Stamped with the baseline so the next batch can tell whether the two share a basis. Note it does NOT catch a change to column widths or presets, which move strip positions without touching the work area.
| bool PhosphorScrollEngine::ScrollState::hasResolvedAxis |
( |
| ) |
const |
|
inline |
The axis this state was last RESOLVED against, which is a different question from lastAppliedAxis above.
The applied basis is stamped only on an EMITTED batch, deliberately, so it keeps describing what the compositor is actually showing. A flip sweep cannot key on that: a relayout suppressed by the emit-on-change gate would leave the old axis standing and the sweep would fire again later against a basis it already converted. This one advances on every resolve.
| QString PhosphorScrollEngine::ScrollState::lastFloatingFocus |
( |
| ) |
const |
|
inline |
Focus-side memory for switch-focus-between-floating-and-tiling: the float most recently reported focused by the compositor, and whether the float layer holds focus RIGHT NOW.
Writers fall into three classes: genuine focus reports (windowFocused), the engine's own activation arms (applyLayout's focus arm and the floating/tiling switch), and the float/unfloat/adoption/handoff transitions that move focus with NO compositor round trip (floatWindowInternal's active-tile arm, unfloat's insert-refused restore, the boundary-move refusal adoption, handoffReceive's heldFocus seed, and clearSourceFloatFocusAfterCrossing on the clearing side). Neither field is serialized — focus history dies with the session.
PER-STATE, while focus is global: only the state owning the newly focused window is updated by a focus report, so a sibling screen's flag can stay stale until the next report names a window that sibling tracks. Accepted: the flag self-heals on the next genuine focus report for that state, and clearing across states would couple per-screen ownership in ways no consumer currently needs.