Skip to main content

SystemChange

Enum SystemChange 

Source
pub enum SystemChange {
Show 30 variants TextSelectionClick { position: LogicalPosition, timestamp: Instant, }, TextSelectionDrag { start_position: LogicalPosition, current_position: LogicalPosition, }, ApplySelectionOp { target: DomNodeId, op: SelectionOp, seat_id: u64, }, CopyToClipboard, CutToClipboard { target: DomNodeId, }, PasteFromClipboard, SelectAllText, UndoTextEdit { target: DomNodeId, }, RedoTextEdit { target: DomNodeId, }, AddCursorAtClick { position: LogicalPosition, }, SelectNextOccurrence { target: DomNodeId, }, SeatShortcut { seat_id: u64, target: DomNodeId, shortcut: KeyboardShortcut, }, ApplyPendingTextInput, ApplyTextChangeset, ActivateNodeDrag { dom_id: DomId, node_id: NodeId, }, ActivateWindowDrag, InitDragVisualState, SetDragOverState { target: DomNodeId, active: bool, }, UpdateDropTarget { target: DomNodeId, }, UpdateDragGpuTransform, DeactivateDrag, SetSeatFocus { seat_id: u64, new_focus: Option<DomNodeId>, old_focus: Option<DomNodeId>, }, SetFocus { new_focus: Option<DomNodeId>, old_focus: Option<DomNodeId>, visible: bool, }, ClearAllSelections, FinalizePendingFocusChanges, ScrollSelectionIntoView, ScrollNodeIntoView { target: DomNodeId, }, ScrollCursorIntoViewAfterTextInput, StartAutoScrollTimer, StopAutoScrollTimer,
}
Expand description

Framework-determined side effects (system changes).

Unlike CallbackChange (from user callbacks), these are determined by the framework’s event analysis: hit tests, gesture detection, focus rules, text selection, keyboard shortcuts, etc.

Both CallbackChange (user) and SystemChange (framework) are processed through exhaustive match on PlatformWindowV2 — adding a new variant causes a compile error in apply_system_change().

Variants§

§

TextSelectionClick

Advance layout animations by an EXACT step, bypassing the wall clock.

Only the E2E surface emits this. A headless scenario cannot sample real time: the same test would land on a different point of the curve on a fast machine than a slow one, so any assertion mid-flight would be flaky. Stepping by a fixed dt makes the trajectory a pure function of how many times this ran.

A SystemChange rather than a direct call because CallbackInfo hands out &LayoutWindow only — mutation is required to go through this channel, which is also where the mutable window actually exists. Process a mouse click for text selection (single/double/triple click).

Fields

§timestamp: Instant
§

TextSelectionDrag

Extend text selection via mouse drag.

Fields

§start_position: LogicalPosition
§current_position: LogicalPosition
§

ApplySelectionOp

Unified selection operation: cursor movement, selection extension, or deletion.

Replaces the old ArrowKeyNavigation and DeleteTextSelection variants. Every keyboard shortcut maps to a single SelectionOp — see its docs.

Fields

§target: DomNodeId
§seat_id: u64

The SEAT whose key this was (9b-ii-a-i-d-ii-b): the op acts on that seat’s caret. Seat 0 is the primary.

§

CopyToClipboard

Copy selected text to system clipboard (Ctrl+C / Cmd+C).

§

CutToClipboard

Cut selected text to clipboard and delete (Ctrl+X / Cmd+X).

Fields

§target: DomNodeId
§

PasteFromClipboard

Paste text from system clipboard at cursor (Ctrl+V / Cmd+V).

§

SelectAllText

Select all text in focused node (Ctrl+A / Cmd+A).

§

UndoTextEdit

Undo last text edit (Ctrl+Z / Cmd+Z).

Fields

§target: DomNodeId
§

RedoTextEdit

Redo last undone edit (Ctrl+Y / Ctrl+Shift+Z / Cmd+Shift+Z).

Fields

§target: DomNodeId
§

AddCursorAtClick

Add a cursor at the clicked position (Ctrl+Click). The position will be hit-tested to find the text cursor location.

Fields

§

SelectNextOccurrence

Select the next occurrence of the current selection’s text (Ctrl+D). If the primary selection is a cursor, expand it to the word first.

Fields

§target: DomNodeId
§

SeatShortcut

A NON-primary seat’s editing shortcut (9b-ii-a-i-d-ii-b-i): Copy / Cut / Paste / Select-all / Undo / Redo on THAT seat’s focus and caret. The primary’s shortcuts stay the dedicated variants above.

Fields

§seat_id: u64
§target: DomNodeId
§

ApplyPendingTextInput

Apply pending text input from platform (keyboard/IME).

§

ApplyTextChangeset

Apply text changeset (incremental relayout).

§

ActivateNodeDrag

Activate node drag on a draggable element.

Fields

§dom_id: DomId
§node_id: NodeId
§

ActivateWindowDrag

Activate window drag (CSD titlebar).

§

InitDragVisualState

Set up drag visual state (:dragging pseudo-state, GPU transform key).

§

SetDragOverState

Set :drag-over pseudo-state on a target node.

Fields

§target: DomNodeId
§active: bool
§

UpdateDropTarget

Update current drop target in drag context.

Fields

§target: DomNodeId
§

UpdateDragGpuTransform

Update GPU transform for active node drag.

§

DeactivateDrag

End drag: clear pseudo-states, remove GPU keys, end drag session.

§

SetSeatFocus

Move a NON-primary seat’s focus (9b-ii-a-i-d): only that seat’s entry changes - no :focus restyle, no caret / blink timer, no soft keyboard, which all follow the primary’s focus (the text-edit session is one). A primary-seat change is SetFocus.

Fields

§seat_id: u64
§new_focus: Option<DomNodeId>
§old_focus: Option<DomNodeId>
§

SetFocus

Change focus to a new target (or clear focus if None). Handles: set_focused_node, apply_focus_restyle, scroll_node_into_view, cursor_blink_timer start/stop.

Fields

§new_focus: Option<DomNodeId>
§old_focus: Option<DomNodeId>
§visible: bool

Should this focus be INDICATED - the W3C :focus-visible question.

It travels WITH the change because the handler restyles and regenerates the display list, and the focus ring is emitted by that regeneration. Setting the flag afterwards (which the shell used to do for the keyboard route) means the frame that was just built did not know focus was indicated, so the ring only appeared on whatever repaint happened NEXT - a click, a resize. On the device that read as “Tab does not ring anything until you click something”, while the E2E harness - which happened to set the flag first - showed a ring and passed (device report, 2026-09-01).

§

ClearAllSelections

Clear all text selections.

§

FinalizePendingFocusChanges

Finalize pending focus changes (cursor initialization after layout).

§

ScrollSelectionIntoView

Scroll cursor/selection into view.

§

ScrollNodeIntoView

Scroll a specific node into view.

Fields

§target: DomNodeId
§

ScrollCursorIntoViewAfterTextInput

Scroll cursor into view after text input (needs relayout first).

§

StartAutoScrollTimer

Start auto-scroll timer for drag-to-scroll (60Hz).

§

StopAutoScrollTimer

Cancel auto-scroll timer.

Trait Implementations§

Source§

impl Clone for SystemChange

Source§

fn clone(&self) -> SystemChange

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SystemChange

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SystemChange

Source§

impl FromIterator<SystemChange> for SystemChangeVec

Source§

fn from_iter<T>(iter: T) -> Self
where T: IntoIterator<Item = SystemChange>,

Creates a value from an iterator. Read more
Source§

impl PartialEq for SystemChange

Source§

fn eq(&self, other: &SystemChange) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SystemChange

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.