pub struct WindowOptions {Show 20 fields
pub window_bounds: Option<WindowBounds>,
pub titlebar: Option<TitlebarOptions>,
pub focus: bool,
pub show: bool,
pub kind: WindowKind,
pub is_movable: bool,
pub app_owns_titlebar_drag: bool,
pub inactive_frame_interval: Option<Duration>,
pub low_power_frame_interval: Option<Duration>,
pub thermal_frame_interval: Option<Duration>,
pub is_resizable: bool,
pub is_minimizable: bool,
pub display_id: Option<DisplayId>,
pub window_background: WindowBackgroundAppearance,
pub app_id: Option<String>,
pub window_min_size: Option<Size<Pixels>>,
pub window_decorations: Option<WindowDecorations>,
pub icon: Option<Arc<RgbaImage>>,
pub tabbing_identifier: Option<String>,
pub use_display_p3: bool,
}Expand description
The variables that can be configured when creating a new window
Fields§
§window_bounds: Option<WindowBounds>Specifies the state and bounds of the window in screen coordinates.
None: Inherit the bounds.Some(WindowBounds): Open a window with corresponding state and its restore size.
titlebar: Option<TitlebarOptions>The titlebar configuration of the window
focus: boolWhether the window should be focused when created
show: boolWhether the window should be shown when created
kind: WindowKindThe kind of window to create
is_movable: boolWhether the window can be moved by the user. When false, the user cannot drag
the window (on macOS this sets NSWindow.isMovable, which also disables the
Window-menu tiling items); programmatic moves are still allowed.
app_owns_titlebar_drag: boolWhether the application owns dragging of the (custom) titlebar, rather than AppKit. Only has an effect on macOS.
Set this to true for windows that draw their own titlebar and move the window
themselves via Window::start_window_move. It marks the whole content view as
app-owned titlebar content, so AppKit neither drags the window from the titlebar
nor delays titlebar clicks while disambiguating double-clicks (a delay first
observed on macOS 27). It is independent of is_movable, so such windows stay
user-movable (via their own drag) and keep the Window-menu tiling items enabled.
Leave this false for windows that rely on AppKit’s native titlebar dragging.
inactive_frame_interval: Option<Duration>The minimum interval between animation frames while the window is inactive.
Defaults to 33.3 ms (about 30 fps). Set to None to disable inactive-window
animation frame throttling, for example for a second window showing a live
canvas. It can only be set when the window is created.
The limit applies to frames with pending Window::on_next_frame callbacks
(including Window::request_animation_frame) or a forced render, in a
window that is not active and is not receiving input at 60 or more events
per second. A redraw requested only with cx.notify() is not throttled.
Other caps on those same animation frames, independent of this setting, are
low_power_frame_interval and
thermal_frame_interval. When several apply,
the longest interval wins. Mandatory platform presentations bypass every limit.
low_power_frame_interval: Option<Duration>The minimum interval between animation frames while the platform reports low-power mode (macOS, Windows and Linux), in every window.
Defaults to 33.3 ms (about 30 fps). Set to None to disable this limit. Like
inactive_frame_interval, it applies only to
animation frames and forced renders, not to redraws requested with cx.notify().
It can only be set when the window is created.
thermal_frame_interval: Option<Duration>The minimum interval between animation frames under serious or critical thermal pressure (reported on macOS only).
Defaults to 16.7 ms (about 60 fps). Set to None to disable this limit. Like
inactive_frame_interval, it applies only to
animation frames and forced renders, not to redraws requested with cx.notify().
It can only be set when the window is created.
is_resizable: boolWhether the window should be resizable by the user
is_minimizable: boolWhether the window should be minimized by the user
display_id: Option<DisplayId>The display to create the window on, if this is None, the window will be created on the main display
window_background: WindowBackgroundAppearanceThe appearance of the window background.
app_id: Option<String>Application identifier of the window. Can by used by desktop environments to group applications together.
window_min_size: Option<Size<Pixels>>Window minimum size
window_decorations: Option<WindowDecorations>Whether to use client or server-side decorations on X11 and Wayland. The platform may ignore requests it cannot satisfy.
icon: Option<Arc<RgbaImage>>Icon image (X11 only)
tabbing_identifier: Option<String>Tab group name, allows opening the window as a native tab on macOS 10.12+. Windows with the same tabbing identifier will be grouped together.
use_display_p3: boolRequest wide-gamut SDR presentation on macOS using the Display P3
compositor. Existing UI colors retain their sRGB interpretation.
Unsupported requests (including transparent windows) keep the default
presentation mode; inspect Window::color_status after creation.
Trait Implementations§
Source§impl Debug for WindowOptions
impl Debug for WindowOptions
Auto Trait Implementations§
impl Forget for WindowOptions
impl Freeze for WindowOptions
impl Move for WindowOptions
impl RefUnwindSafe for WindowOptions
impl Send for WindowOptions
impl Sync for WindowOptions
impl Unpin for WindowOptions
impl UnsafeUnpin for WindowOptions
impl UnwindSafe for WindowOptions
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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().