Trait winit::platform::unix::WindowBuilderExtUnix
source · pub trait WindowBuilderExtUnix {
// Required methods
fn with_x11_visual<T>(self, visual_infos: *const T) -> Self;
fn with_x11_screen(self, screen_id: i32) -> Self;
fn with_name(
self,
general: impl Into<String>,
instance: impl Into<String>
) -> Self;
fn with_override_redirect(self, override_redirect: bool) -> Self;
fn with_x11_window_type(self, x11_window_type: Vec<XWindowType>) -> Self;
fn with_gtk_theme_variant(self, variant: String) -> Self;
fn with_wayland_csd_theme(self, theme: Theme) -> Self;
fn with_resize_increments<S: Into<Size>>(self, increments: S) -> Self;
fn with_base_size<S: Into<Size>>(self, base_size: S) -> Self;
}
Expand description
Additional methods on WindowBuilder
that are specific to Unix.
Required Methods§
fn with_x11_visual<T>(self, visual_infos: *const T) -> Self
fn with_x11_screen(self, screen_id: i32) -> Self
sourcefn with_name(
self,
general: impl Into<String>,
instance: impl Into<String>
) -> Self
fn with_name( self, general: impl Into<String>, instance: impl Into<String> ) -> Self
Build window with the given general
and instance
names.
On Wayland, the general
name sets an application ID, which should match the .desktop
file destributed with your program. The instance
is a no-op
.
On X11, the general
sets general class of WM_CLASS(STRING)
, while instance
set the
instance part of it. The resulted property looks like WM_CLASS(STRING) = "general", "instance"
.
For details about application ID conventions, see the Desktop Entry Spec
sourcefn with_override_redirect(self, override_redirect: bool) -> Self
fn with_override_redirect(self, override_redirect: bool) -> Self
Build window with override-redirect flag; defaults to false. Only relevant on X11.
sourcefn with_x11_window_type(self, x11_window_type: Vec<XWindowType>) -> Self
fn with_x11_window_type(self, x11_window_type: Vec<XWindowType>) -> Self
Build window with _NET_WM_WINDOW_TYPE
hints; defaults to Normal
. Only relevant on X11.
sourcefn with_gtk_theme_variant(self, variant: String) -> Self
fn with_gtk_theme_variant(self, variant: String) -> Self
Build window with _GTK_THEME_VARIANT
hint set to the specified value. Currently only relevant on X11.
sourcefn with_wayland_csd_theme(self, theme: Theme) -> Self
fn with_wayland_csd_theme(self, theme: Theme) -> Self
Build window with certain decoration Theme
You can also use WINIT_WAYLAND_CSD_THEME
env variable to set the theme.
Possible values for env variable are: “dark” and light“
sourcefn with_resize_increments<S: Into<Size>>(self, increments: S) -> Self
fn with_resize_increments<S: Into<Size>>(self, increments: S) -> Self
Build window with resize increment hint. Only implemented on X11.
// Specify the size in logical dimensions like this:
WindowBuilder::new().with_resize_increments(LogicalSize::new(400.0, 200.0));
// Or specify the size in physical dimensions like this:
WindowBuilder::new().with_resize_increments(PhysicalSize::new(400, 200));
sourcefn with_base_size<S: Into<Size>>(self, base_size: S) -> Self
fn with_base_size<S: Into<Size>>(self, base_size: S) -> Self
Build window with base size hint. Only implemented on X11.
// Specify the size in logical dimensions like this:
WindowBuilder::new().with_base_size(LogicalSize::new(400.0, 200.0));
// Or specify the size in physical dimensions like this:
WindowBuilder::new().with_base_size(PhysicalSize::new(400, 200));