pub trait WindowAttributesExtX11 {
// Required methods
fn with_x11_visual(self, visual_id: XVisualID) -> 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<WindowType>) -> Self;
fn with_base_size<S: Into<Size>>(self, base_size: S) -> Self;
fn with_embed_parent_window(self, parent_window_id: XWindow) -> Self;
}
Expand description
Additional methods on WindowAttributes
that are specific to X11.
Required Methods§
Sourcefn with_x11_visual(self, visual_id: XVisualID) -> Self
fn with_x11_visual(self, visual_id: XVisualID) -> Self
Create this window with a specific X11 visual.
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.
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) = "instance", "general"
.
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.
Sourcefn with_x11_window_type(self, x11_window_type: Vec<WindowType>) -> Self
fn with_x11_window_type(self, x11_window_type: Vec<WindowType>) -> Self
Build window with _NET_WM_WINDOW_TYPE
hints; defaults to Normal
.
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.
// Specify the size in logical dimensions like this:
Window::default_attributes().with_base_size(LogicalSize::new(400.0, 200.0));
// Or specify the size in physical dimensions like this:
Window::default_attributes().with_base_size(PhysicalSize::new(400, 200));
Sourcefn with_embed_parent_window(self, parent_window_id: XWindow) -> Self
fn with_embed_parent_window(self, parent_window_id: XWindow) -> Self
Embed this window into another parent window.
§Example
use rio_window::window::Window;
use rio_window::event_loop::ActiveEventLoop;
use rio_window::platform::x11::{XWindow, WindowAttributesExtX11};
let parent_window_id = std::env::args().nth(1).unwrap().parse::<XWindow>()?;
let window_attributes = Window::default_attributes().with_embed_parent_window(parent_window_id);
let window = event_loop.create_window(window_attributes)?;
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.