pub enum X11Window {
Pure(PureX11Window),
Xlib(XlibWindowInner),
}Expand description
Unified Linux X11 desktop window instance.
Transparently uses PureX11Window by default, falling back to legacy xlib if requested and available.
Variants§
Pure(PureX11Window)
Xlib(XlibWindowInner)
Implementations§
Source§impl X11Window
impl X11Window
Sourcepub fn new(config: WindowConfig) -> Result<Self, String>
pub fn new(config: WindowConfig) -> Result<Self, String>
Instantiates an X11 window according to the provided configuration.
Sourcepub fn is_pure(&self) -> bool
pub fn is_pure(&self) -> bool
Returns true if the window is driven by pure-Rust wire protocols without C xlib.
Sourcepub fn present_bgra(
&mut self,
buffer: &[u8],
width: u32,
height: u32,
) -> Result<(), PresentError>
pub fn present_bgra( &mut self, buffer: &[u8], width: u32, height: u32, ) -> Result<(), PresentError>
Presents a BGRA8 pixel slice directly to the X11 surface.
Sourcepub fn poll_native_events(&mut self) -> Vec<PlatformEvent>
pub fn poll_native_events(&mut self) -> Vec<PlatformEvent>
Polls pending platform events without blocking.
Trait Implementations§
Source§impl NativeSurfaceWindow for X11Window
impl NativeSurfaceWindow for X11Window
Source§fn present_surface(
&mut self,
pixels: &[u8],
width: u32,
height: u32,
) -> Result<(), PresentError>
fn present_surface( &mut self, pixels: &[u8], width: u32, height: u32, ) -> Result<(), PresentError>
Blits a 32-bit BGRA uncompressed buffer to the window client area.
Source§impl PlatformWindow for X11Window
impl PlatformWindow for X11Window
fn title(&self) -> &str
fn set_title(&mut self, title: &str)
fn size(&self) -> (u32, u32)
fn set_size(&mut self, width: u32, height: u32)
fn scale_factor(&self) -> f32
fn set_scale_factor(&mut self, scale_factor: f32)
fn mode(&self) -> WindowMode
fn set_mode(&mut self, mode: WindowMode)
fn is_focused(&self) -> bool
fn set_focused(&mut self, focused: bool)
fn cursor(&self) -> CursorIcon
fn set_cursor(&mut self, cursor: CursorIcon)
fn request_redraw(&mut self)
fn is_redraw_requested(&self) -> bool
fn poll_events(&mut self) -> Vec<PlatformEvent>
fn push_event(&mut self, event: PlatformEvent)
Source§fn begin_window_drag(&mut self, x: f32, y: f32)
fn begin_window_drag(&mut self, x: f32, y: f32)
Initiates an interactive window drag operation with the native window manager.
Source§fn begin_window_resize(&mut self, edge: CsdHitZone, x: f32, y: f32)
fn begin_window_resize(&mut self, edge: CsdHitZone, x: f32, y: f32)
Initiates an interactive window resize operation with the native window manager.
Source§fn current_monitor(&self) -> Option<MonitorInfo>
fn current_monitor(&self) -> Option<MonitorInfo>
Returns the monitor containing the center of this window, if known.
Source§fn available_monitors(&self) -> Vec<MonitorInfo>
fn available_monitors(&self) -> Vec<MonitorInfo>
Returns the list of currently connected physical display monitors.
Source§fn primary_monitor(&self) -> Option<MonitorInfo>
fn primary_monitor(&self) -> Option<MonitorInfo>
Returns the primary system monitor.
Source§fn on_accessibility_update(&mut self, _json_payload: &str)
fn on_accessibility_update(&mut self, _json_payload: &str)
Transmits an incremental AccessKit/OS accessibility tree update to native screen readers.
Source§fn set_ime_cursor_location(
&mut self,
_x: i32,
_y: i32,
_width: i32,
_height: i32,
)
fn set_ime_cursor_location( &mut self, _x: i32, _y: i32, _width: i32, _height: i32, )
Sets candidate window positioning following active text caret coordinate.
Source§fn set_ime_surrounding_text(&mut self, _text: &str, _cursor_index: i32)
fn set_ime_surrounding_text(&mut self, _text: &str, _cursor_index: i32)
Updates surrounding text buffer for context-aware IME prediction.
Source§fn toggle_maximize(&mut self) -> bool
fn toggle_maximize(&mut self) -> bool
Toggles the window maximized state and returns true if the window is now maximized.
Auto Trait Implementations§
impl !Send for X11Window
impl !Sync for X11Window
impl Forget for X11Window
impl Freeze for X11Window
impl Move for X11Window
impl RefUnwindSafe for X11Window
impl Unpin for X11Window
impl UnsafeUnpin for X11Window
impl UnwindSafe for X11Window
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