Skip to main content

LinuxPlatform

Struct LinuxPlatform 

Source
pub struct LinuxPlatform { /* private fields */ }
Expand description

Direct Linux X11 / Wayland (dlopen-loaded) + Vulkan platform backend.

Implementations§

Source§

impl LinuxPlatform

X11/Wayland system event injection and Wayland VSync/output callbacks for LinuxPlatform.

Source

pub fn push_system_event(&mut self, event: SystemEvent)

Enqueues a normalized Linux SystemEvent to be drained on the next poll_events() tick.

§Arguments
  • SystemEvent - System event to enqueue.
Source

pub fn on_wayland_output_mode(&mut self, id: WindowId, refresh_milli_hz: u32)

Records a Wayland wl_output.mode refresh rate in millihertz (e.g. 240000 -> 240Hz) for id.

§Arguments
  • WindowId - Target Wayland window identifier.
  • u32 - Output refresh rate in millihertz.
Source

pub fn on_wayland_frame_callback(&mut self, id: WindowId)

Handles a Wayland wl_surface::frame done callback and schedules a redraw when active.

§Arguments
  • WindowId - Target Wayland window identifier.
Source

pub fn on_wayland_presentation_feedback( &mut self, id: WindowId, timestamp_ns: u64, )

Records a Wayland wp_presentation feedback timestamp in nanoseconds for id.

§Arguments
  • WindowId - Target Wayland window identifier.
  • u64 - Compositor presentation timestamp in nanoseconds.
Source

pub fn on_wayland_buffer_release(&mut self, id: WindowId, slot: usize)

Marks Wayland shm double-buffer slot slot (0 or 1) as released by the compositor for window id.

§Arguments
  • WindowId - Target Wayland window identifier.
  • usize - Released double-buffer slot index (0 or 1).
Source

pub fn cpu_mirror_active(&self, id: WindowId) -> bool

Returns whether a CPU software framebuffer mirror is currently active on Linux window id.

§Arguments
  • WindowId - Target Linux window identifier.
§Returns
  • bool - true when presenting via Wayland wl_shm or X11 software blitting; false when direct GPU Vulkan WSI is active.
Source

pub fn last_present_telemetry( &self, id: WindowId, ) -> Option<LinuxPresentTelemetry>

Returns the most recent Linux presentation telemetry snapshot for window id.

§Arguments
  • WindowId - Target Linux window identifier.
§Returns
  • Option<LinuxPresentTelemetry> - Latest presentation telemetry, if the window exists.
Source

pub fn present_framebuffer_with_outcome( &mut self, id: WindowId, framebuffer: &Framebuffer, damage: DamageRegion, ) -> Result<LinuxPresentTelemetry, PlatformError>

Presents framebuffer (or only damage) on Linux window id and returns explicit Submitted/SkippedUnchanged/Failed telemetry.

§Arguments
  • WindowId - Target window handle.
  • &Framebuffer - Rendered RGBA8 framebuffer.
  • DamageRegion - Damaged pixel region updated this frame.
§Returns
  • Result<LinuxPresentTelemetry, PlatformError> - Presentation telemetry on commit or skip; Err on failure.
Source

pub fn present_gpu_direct_hook( &mut self, id: WindowId, ) -> Result<LinuxPresentTelemetry, PlatformError>

Records a direct Vulkan WSI GPU presentation on Wayland (VK_KHR_wayland_surface) or X11 (VK_KHR_xlib_surface) with cpu_mirror_active = false.

§Arguments
  • WindowId - Target Linux window handle.
§Returns
  • Result<LinuxPresentTelemetry, PlatformError> - Direct GPU telemetry (cpu_mirror_active = false), or Err when WSI is unavailable.
Source§

impl LinuxPlatform

Source

pub fn get_windows(&self) -> &HashMap<WindowId, LinuxWindowRecord>

Source

pub fn get_mut_windows(&mut self) -> &mut HashMap<WindowId, LinuxWindowRecord>

Source

pub fn set_windows( &mut self, val: HashMap<WindowId, LinuxWindowRecord>, ) -> &mut Self

Source

pub fn get_pending_events(&self) -> &Vec<WindowEvent>

Source

pub fn get_mut_pending_events(&mut self) -> &mut Vec<WindowEvent>

Source

pub fn set_pending_events(&mut self, val: Vec<WindowEvent>) -> &mut Self

Source

pub fn get_mut_clipboard_cache(&mut self) -> &mut Option<String>

Source

pub fn set_clipboard_cache(&mut self, val: Option<String>) -> &mut Self

Source

pub fn get_mut_pump_paused(&mut self) -> &mut bool

Trait Implementations§

Source§

impl Clone for LinuxPlatform

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LinuxPlatform

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LinuxPlatform

Default initialization for LinuxPlatform.

Source§

fn default() -> Self

Creates an empty Linux X11 / Wayland platform backend.

§Returns
  • Self - Initialized Linux backend.
Source§

impl PlatformBackend for LinuxPlatform

PlatformBackend implementation for native Linux.

Source§

fn kind(&self) -> PlatformKind

Returns PlatformKind::Linux.

§Arguments
  • &Self - Platform reference.
§Returns
  • PlatformKind - PlatformKind::Linux.
Source§

fn capabilities(&self) -> PlatformCapabilities

Returns Linux desktop capabilities.

§Arguments
  • &Self - Platform reference.
§Returns
  • PlatformCapabilities - Linux capability flags.
Source§

fn create_window( &mut self, config: &WindowConfig, ) -> Result<WindowState, PlatformError>

Opens an X11 or Wayland window via dynamic dlopen.

§Arguments
  • &Self - Mutable Linux platform.
  • &WindowConfig - Declarative window config.
§Returns
  • Result<WindowState, PlatformError> - Initial window state.
Source§

fn window_state(&self, id: WindowId) -> Option<WindowState>

Queries live WindowState for id.

§Arguments
  • &Self - Platform reference.
  • WindowId - Window handle.
§Returns
  • Option<WindowState> - Window state if open.
Source§

fn raw_window_handle(&self, id: WindowId) -> RawWindowHandle

Returns RawWindowHandle::Xlib or RawWindowHandle::Wayland for Vulkan/EGL surface binding.

§Arguments
  • &Self - Platform reference.
  • WindowId - Window handle.
§Returns
  • RawWindowHandle - Native Linux display/window handle.
Source§

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

Pumps pending X11 events and drains queued Linux events.

§Arguments
  • &Self - Mutable Linux platform.
§Returns
  • Vec<WindowEvent> - Pending events.
Source§

fn wait_for_events(&mut self) -> Vec<WindowEvent>

Blocks on Wayland wl_display_dispatch or X11 XNextEvent with zero CPU usage until an OS event wakes the connection.

§Returns
  • Vec<WindowEvent> - Events received upon wake.
Source§

fn set_frame_pump_paused(&mut self, paused: bool)

Updates Linux background frame-pump pause state.

§Arguments
  • &Self - Mutable Linux platform.
  • bool - true when paused in background; false when active.
Source§

fn is_frame_pump_paused(&self) -> bool

Returns whether the Linux frame pump is currently paused for background freeze.

§Arguments
  • &Self - Platform reference.
§Returns
  • bool - true when paused in background.
Source§

fn present_framebuffer( &mut self, id: WindowId, framebuffer: &Framebuffer, ) -> Result<(), PlatformError>

Presents framebuffer to the active Linux window surface via X11 XCreateImage + XPutImage.

§Arguments
  • &Self - Mutable Linux platform.
  • WindowId - Target window handle.
  • &Framebuffer - Rendered RGBA8 framebuffer.
§Returns
  • Result<(), PlatformError> - Presentation status.
Source§

fn present_framebuffer_region( &mut self, id: WindowId, framebuffer: &Framebuffer, damage: DamageRegion, ) -> Result<(), PlatformError>

Presents framebuffer (or only damage) onto the active Linux X11 or Wayland window and maps X11 windows after Frame 1.

§Arguments
  • WindowId - Target window handle.
  • &Framebuffer - Rendered RGBA8 framebuffer.
  • DamageRegion - Damaged pixel region updated this frame.
§Returns
  • Result<(), PlatformError> - Presentation status.
Source§

fn read_clipboard(&self) -> Option<String>

Reads cached clipboard text.

§Arguments
  • &Self - Platform reference.
§Returns
  • Option<String> - Clipboard contents.
Source§

fn write_clipboard(&mut self, text: &str) -> Result<(), PlatformError>

Writes text to clipboard cache.

§Arguments
  • &Self - Mutable platform.
  • &str - Clipboard text.
§Returns
  • Result<(), PlatformError> - Write status.
Source§

fn system_theme(&self) -> ThemeMode

Returns active system theme mode.

§Arguments
  • &Self - Platform reference.
§Returns
  • ThemeMode - Active appearance mode.
Source§

fn display_refresh_rate_hz(&self) -> f32

Queries the native Linux display refresh rate via XRandR or EUV_REFRESH_RATE_HZ.

§Arguments
  • &Self - Platform reference.
§Returns
  • f32 - Active display refresh rate in Hertz.
Source§

impl WindowController for LinuxPlatform

WindowController implementation for Linux X11 / Wayland.

Source§

fn apply_command(&mut self, command: WindowCommand) -> Result<(), PlatformError>

Applies a WindowCommand onto the native X11 or Wayland window.

§Arguments
  • WindowCommand - Command to apply.
§Returns
  • Result<(), PlatformError> - Execution status.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.