Skip to main content

WindowState

Struct WindowState 

Source
pub struct WindowState {
Show 33 fields pub painted_root: u32, pub focused_node: u32, pub pending_blur: u32, pub focus_subs: HashMap<u32, Subscription>, pub focus_lost: Option<Subscription>, pub bounds: HashMap<u32, Rect, BuildHasherDefault<IdHasher>>, pub prev_bounds: HashMap<u32, Rect, BuildHasherDefault<IdHasher>>, pub transformed: HashMap<u32, Rect, BuildHasherDefault<IdHasher>>, pub prev_transformed: HashMap<u32, Rect, BuildHasherDefault<IdHasher>>, pub pending_mouse_move: Option<PendingMouseMove>, pub mouse_movement: Point<Pixels>, pub pointer_capture: Option<u32>, pub down_claimed: bool, pub press_focus: PressFocus, pub up_waves: Vec<UpWave>, pub press: Option<Press>, pub hit: Option<u32>, pub down_hit: Option<u32>, pub hover: Hover, pub active: Option<u32>, pub keyboard_input: bool, pub activation: Option<Subscription>, pub key_prevented: bool, pub key_event_claimed: u64, pub key_click: Option<KeyClick>, pub space_armed: Option<u32>, pub any_drag_region: bool, pub control_hitboxes: Vec<(u32, WindowControlArea)>, pub os_chrome: bool, pub full_res_images: bool, pub env: Option<Env>, pub pending_drops: Vec<Arc<RenderImage>>, pub pending_uploads: Vec<PendingUpload>,
}

Fields§

§painted_root: u32

The node this window paints as its root: 0 for the primary window, the popped-out node for a pop-out.

§focused_node: u32§pending_blur: u32

Queued by gc_node_state (which has no Window), applied by the next frame tick that does.

§focus_subs: HashMap<u32, Subscription>§focus_lost: Option<Subscription>

Registered per window (cx.on_focus_lost), so a pop-out needs its own or focus leaving it is invisible.

§bounds: HashMap<u32, Rect, BuildHasherDefault<IdHasher>>§prev_bounds: HashMap<u32, Rect, BuildHasherDefault<IdHasher>>

The previous frame’s Self::bounds: the element tree for frame N is built before N’s prepaint, so a builder can only read last frame’s (<lottie>, <video> size relatively).

§transformed: HashMap<u32, Rect, BuildHasherDefault<IdHasher>>§prev_transformed: HashMap<u32, Rect, BuildHasherDefault<IdHasher>>§pending_mouse_move: Option<PendingMouseMove>§mouse_movement: Point<Pixels>

The moves since the last delivered mousemove: its movementX/movementY.

§pointer_capture: Option<u32>§down_claimed: bool

Has a node already taken THIS mouse-down? gpui runs on_any_mouse_down on every listening box under the pointer; the browser has one target, so without the claim an outer listener ran twice.

§press_focus: PressFocus§up_waves: Vec<UpWave>

Mouse-up waves not yet delivered (render::UpWave): listeners only claim, one deferred flush delivers in DOM order.

§press: Option<Press>

The press in progress (render::Press), kept outside gpui element state so cached/direct render switches cannot lose it.

§hit: Option<u32>§down_hit: Option<u32>§hover: Hover§active: Option<u32>§keyboard_input: bool§activation: Option<Subscription>§key_prevented: bool§key_event_claimed: u64§key_click: Option<KeyClick>§space_armed: Option<u32>§any_drag_region: bool§control_hitboxes: Vec<(u32, WindowControlArea)>§os_chrome: bool§full_res_images: bool§env: Option<Env>§pending_drops: Vec<Arc<RenderImage>>§pending_uploads: Vec<PendingUpload>

Trait Implementations§

Source§

impl Default for WindowState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more