#[repr(C, u8)]pub enum WindowPosition {
Uninitialized,
Initialized(PhysicalPositionI32),
RelativeToParentWindow(PhysicalPositionI32),
}Expand description
Position of the window on screen
Variants§
Uninitialized
Initialized(PhysicalPositionI32)
Absolute position on the virtual screen (physical px). The default for top-level windows.
RelativeToParentWindow(PhysicalPositionI32)
Offset (physical px) from the PARENT window’s top-left corner. Used by
child windows (menus, dropdowns, popups) together with
WindowCreateOptions.parent_window_id: the backend resolves the final
screen position as parent_top_left + offset. This is robust where
absolute screen coordinates aren’t available — notably Wayland, whose
xdg_popup / subsurface protocol positions relative to the parent. Falls
back to absolute (offset from origin) if there is no parent.
Trait Implementations§
Source§impl Clone for WindowPosition
impl Clone for WindowPosition
Source§fn clone(&self) -> WindowPosition
fn clone(&self) -> WindowPosition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for WindowPosition
Source§impl Debug for WindowPosition
impl Debug for WindowPosition
Source§impl Default for WindowPosition
impl Default for WindowPosition
Source§fn default() -> WindowPosition
fn default() -> WindowPosition
Returns the “default value” for a type. Read more
impl Eq for WindowPosition
Source§impl PartialEq for WindowPosition
impl PartialEq for WindowPosition
impl StructuralPartialEq for WindowPosition
Auto Trait Implementations§
impl Freeze for WindowPosition
impl RefUnwindSafe for WindowPosition
impl Send for WindowPosition
impl Sync for WindowPosition
impl Unpin for WindowPosition
impl UnsafeUnpin for WindowPosition
impl UnwindSafe for WindowPosition
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
Mutably borrows from an owned value. Read more