pub struct WindowGeometry { /* private fields */ }Expand description
One window’s placement on the desktop, as reactive signals the host feeds. Copy handle; create one per window (the provider creates an inert one when none is in context) and keep it updated from your windowing layer. Missing placement or host ineligibility makes it inert: the window still drags internally, but cannot take part in cross-window hit-testing.
Implementations§
Source§impl WindowGeometry
impl WindowGeometry
Sourcepub fn set(&self, origin: Point, size: (f64, f64), scale: f64)
pub fn set(&self, origin: Point, size: (f64, f64), scale: f64)
Update the window’s placement. origin and size describe the
client area in global physical px; scale is the window’s scale
factor. No-op writes are skipped, so this is safe to call from
high-frequency window events.
Sourcepub fn clear(&self)
pub fn clear(&self)
Forget the placement (geometry became unavailable); the window keeps working as a single-window drag surface.
Sourcepub fn set_eligible(&self, eligible: bool)
pub fn set_eligible(&self, eligible: bool)
Include or exclude this window from global hit-testing without discarding its last known placement.
Sourcepub fn eligible(&self) -> bool
pub fn eligible(&self) -> bool
Whether the host currently allows this window to receive a global drag. This is a subscribing, dead-safe read.
Sourcepub fn mark_focused(&self)
pub fn mark_focused(&self)
Record that this window was just focused (see focused).
Sourcepub fn live(&self) -> bool
pub fn live(&self) -> bool
Is the placement known and currently eligible for global hit-testing? This is a subscribing, dead-safe read.
Sourcepub fn to_global(&self, client: Point) -> Option<Point>
pub fn to_global(&self, client: Point) -> Option<Point>
This window’s client CSS px -> global physical px. None until the
placement is known.
Sourcepub fn to_client(&self, global: Point) -> Option<Point>
pub fn to_client(&self, global: Point) -> Option<Point>
Global physical px -> this window’s client CSS px. None until the
placement is known.
Sourcepub fn contains_global(&self, global: Point) -> bool
pub fn contains_global(&self, global: Point) -> bool
Does this eligible window’s client area contain global (physical
px)? Always false while placement is unknown or eligibility is off.
Sourcepub fn focus_stamp(&self) -> u64
pub fn focus_stamp(&self) -> u64
The current focus stamp (0 = never focused).
Trait Implementations§
Source§impl Clone for WindowGeometry
impl Clone for WindowGeometry
impl Copy for WindowGeometry
Source§impl Default for WindowGeometry
impl Default for WindowGeometry
Auto Trait Implementations§
impl !RefUnwindSafe for WindowGeometry
impl !Send for WindowGeometry
impl !Sync for WindowGeometry
impl !UnwindSafe for WindowGeometry
impl Freeze for WindowGeometry
impl Unpin for WindowGeometry
impl UnsafeUnpin for WindowGeometry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().