Struct zng_view_api::window::WindowChanged
source · 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§
§window: WindowId
Window 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: EventCause
What caused the change, end-user/OS modifying the window or the app.
Implementations§
source§impl WindowChanged
impl WindowChanged
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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