Skip to main content

PureX11Window

Struct PureX11Window 

Source
pub struct PureX11Window {
    pub client: PureX11Client,
    pub window_id: u32,
    pub gc_id: u32,
    pub config: WindowConfig,
    pub scale_factor: f32,
    pub is_focused: bool,
    pub cursor: CursorIcon,
    pub redraw_requested: bool,
    pub shm: Option<X11ShmSegment>,
    pub event_queue: VecDeque<PlatformEvent>,
    pub last_click: Option<(Instant, f32, f32)>,
    pub moveresize_atom: Option<u32>,
}
Expand description

Pure-Rust X11 native desktop window instance with MIT-SHM support.

Fields§

§client: PureX11Client§window_id: u32§gc_id: u32§config: WindowConfig§scale_factor: f32§is_focused: bool§cursor: CursorIcon§redraw_requested: bool§shm: Option<X11ShmSegment>§event_queue: VecDeque<PlatformEvent>§last_click: Option<(Instant, f32, f32)>§moveresize_atom: Option<u32>

Implementations§

Source§

impl PureX11Window

Source

pub fn new(config: WindowConfig) -> Result<Self, String>

Creates a native pure-Rust X11 window over the default local display socket.

Source

pub fn connect_to_socket( socket_path: &str, config: WindowConfig, ) -> Result<Self, String>

Connects to a specific socket path and initializes the window and graphics context.

Source

pub fn send_moveresize( &mut self, x: f32, y: f32, direction: u32, button: u32, ) -> Result<(), String>

Dispatches an EWMH _NET_WM_MOVERESIZE client message delegating window drag or resize.

Source

pub fn set_wm_state_maximized(&mut self, maximized: bool) -> Result<(), String>

Dispatches an EWMH _NET_WM_STATE client message for window maximize or restore.

Source

pub fn present_bgra( &mut self, pixels: &[u8], width: u32, height: u32, ) -> Result<(), PresentError>

Presents a BGRA8 pixel buffer directly via MIT-SHM (or streaming PutImage fallback).

Source

pub fn poll_native_events(&mut self) -> Vec<PlatformEvent>

Reads pending 32-byte event packets from the socket and translates them into PlatformEvents.

Source

pub fn handle_32_byte_event(&mut self, pkt: &[u8])

Decodes a single 32-byte X11 event packet into platform events.

Trait Implementations§

Source§

impl NativeSurfaceWindow for PureX11Window

Source§

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 PureX11Window

Source§

fn title(&self) -> &str

Source§

fn set_title(&mut self, title: &str)

Source§

fn size(&self) -> (u32, u32)

Source§

fn set_size(&mut self, width: u32, height: u32)

Source§

fn scale_factor(&self) -> f32

Source§

fn set_scale_factor(&mut self, scale_factor: f32)

Source§

fn mode(&self) -> WindowMode

Source§

fn set_mode(&mut self, mode: WindowMode)

Source§

fn is_focused(&self) -> bool

Source§

fn set_focused(&mut self, focused: bool)

Source§

fn cursor(&self) -> CursorIcon

Source§

fn set_cursor(&mut self, cursor: CursorIcon)

Source§

fn request_redraw(&mut self)

Source§

fn is_redraw_requested(&self) -> bool

Source§

fn poll_events(&mut self) -> Vec<PlatformEvent>

Source§

fn push_event(&mut self, event: PlatformEvent)

Source§

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)

Initiates an interactive window resize operation with the native window manager.
Source§

fn current_monitor(&self) -> Option<MonitorInfo>

Returns the monitor containing the center of this window, if known.
Source§

fn available_monitors(&self) -> Vec<MonitorInfo>

Returns the list of currently connected physical display monitors.
Source§

fn primary_monitor(&self) -> Option<MonitorInfo>

Returns the primary system monitor.
Source§

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, )

Sets candidate window positioning following active text caret coordinate.
Source§

fn set_ime_surrounding_text(&mut self, _text: &str, _cursor_index: i32)

Updates surrounding text buffer for context-aware IME prediction.
Source§

fn reset_ime(&mut self)

Resets active IME composition session.
Source§

fn toggle_maximize(&mut self) -> bool

Toggles the window maximized state and returns true if the window is now maximized.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoInitialState<T> for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>