#[non_exhaustive]pub struct WindowChanged {
pub window: WindowId,
pub state: Option<WindowStateAll>,
pub position: Option<(PxPoint, DipPoint)>,
pub monitor: Option<MonitorId>,
pub size: Option<DipSize>,
pub safe_padding: Option<DipSideOffsets>,
pub frame_wait_id: Option<FrameWaitId>,
pub cause: EventCause,
}Expand description
Event::WindowChanged payload.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.window: WindowIdWindow that has changed state.
state: Option<WindowStateAll>Window new state, is None if the window state did not change.
position: Option<(PxPoint, DipPoint)>Window new global position, is None if the window position did not change.
The values are the global position and the position in the monitor.
monitor: Option<MonitorId>Window new monitor.
The window’s monitor change when it is moved enough so that most of the client area is in the new monitor screen.
size: Option<DipSize>The window new size, is None if the window size did not change.
safe_padding: Option<DipSideOffsets>The window new safe padding, is None if the did not change.
frame_wait_id: Option<FrameWaitId>If the view-process is blocking the event loop for a time waiting for a frame for the new size this
ID must be send with the frame to signal that it is the frame for the new size.
Event loop implementations can use this to resize without visible artifacts
like the clear color flashing on the window corners, there is a timeout to this delay but it
can be a noticeable stutter, a render or render_update request for the window unblocks the loop early
to continue the resize operation.
cause: EventCauseWhat caused the change, end-user/OS modifying the window or the app.
Implementations§
Source§impl WindowChanged
impl WindowChanged
Sourcepub fn new(
window: WindowId,
state: Option<WindowStateAll>,
position: Option<(PxPoint, DipPoint)>,
monitor: Option<MonitorId>,
size: Option<DipSize>,
safe_padding: Option<DipSideOffsets>,
frame_wait_id: Option<FrameWaitId>,
cause: EventCause,
) -> Self
pub fn new( window: WindowId, state: Option<WindowStateAll>, position: Option<(PxPoint, DipPoint)>, monitor: Option<MonitorId>, size: Option<DipSize>, safe_padding: Option<DipSideOffsets>, frame_wait_id: Option<FrameWaitId>, cause: EventCause, ) -> Self
New response.
Sourcepub fn moved(
window: WindowId,
global_position: PxPoint,
position: DipPoint,
cause: EventCause,
) -> Self
pub fn moved( window: WindowId, global_position: PxPoint, position: DipPoint, cause: EventCause, ) -> Self
Create an event that represents window move.
Sourcepub fn monitor_changed(
window: WindowId,
monitor: MonitorId,
cause: EventCause,
) -> Self
pub fn monitor_changed( window: WindowId, monitor: MonitorId, cause: EventCause, ) -> Self
Create an event that represents window parent monitor change.
Sourcepub fn resized(
window: WindowId,
size: DipSize,
cause: EventCause,
frame_wait_id: Option<FrameWaitId>,
) -> Self
pub fn resized( window: WindowId, size: DipSize, cause: EventCause, frame_wait_id: Option<FrameWaitId>, ) -> Self
Create an event that represents window resized.
Sourcepub fn state_changed(
window: WindowId,
state: WindowStateAll,
cause: EventCause,
) -> Self
pub fn state_changed( window: WindowId, state: WindowStateAll, cause: EventCause, ) -> Self
Create an event that represents WindowStateAll change.
Trait Implementations§
Source§impl Clone for WindowChanged
impl Clone for WindowChanged
Source§fn clone(&self) -> WindowChanged
fn clone(&self) -> WindowChanged
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WindowChanged
impl Debug for WindowChanged
Source§impl<'de> Deserialize<'de> for WindowChanged
impl<'de> Deserialize<'de> for WindowChanged
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for WindowChanged
impl RefUnwindSafe for WindowChanged
impl Send for WindowChanged
impl Sync for WindowChanged
impl Unpin for WindowChanged
impl UnwindSafe for WindowChanged
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more