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.
impl LinuxPlatform
X11/Wayland system event injection and Wayland VSync/output callbacks for LinuxPlatform.
Sourcepub fn push_system_event(&mut self, event: SystemEvent)
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.
Sourcepub fn on_wayland_output_mode(&mut self, id: WindowId, refresh_milli_hz: u32)
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.
Sourcepub fn on_wayland_frame_callback(&mut self, id: WindowId)
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.
Sourcepub fn on_wayland_presentation_feedback(
&mut self,
id: WindowId,
timestamp_ns: u64,
)
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.
Sourcepub fn on_wayland_buffer_release(&mut self, id: WindowId, slot: usize)
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 (0or1).
Sourcepub fn cpu_mirror_active(&self, id: WindowId) -> bool
pub fn cpu_mirror_active(&self, id: WindowId) -> bool
Sourcepub fn last_present_telemetry(
&self,
id: WindowId,
) -> Option<LinuxPresentTelemetry>
pub fn last_present_telemetry( &self, id: WindowId, ) -> Option<LinuxPresentTelemetry>
Sourcepub fn present_framebuffer_with_outcome(
&mut self,
id: WindowId,
framebuffer: &Framebuffer,
damage: DamageRegion,
) -> Result<LinuxPresentTelemetry, PlatformError>
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;Erron failure.
Sourcepub fn present_gpu_direct_hook(
&mut self,
id: WindowId,
) -> Result<LinuxPresentTelemetry, PlatformError>
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), orErrwhen WSI is unavailable.
Source§impl LinuxPlatform
impl LinuxPlatform
pub fn get_windows(&self) -> &HashMap<WindowId, LinuxWindowRecord>
pub fn get_mut_windows(&mut self) -> &mut HashMap<WindowId, LinuxWindowRecord>
pub fn set_windows( &mut self, val: HashMap<WindowId, LinuxWindowRecord>, ) -> &mut Self
pub fn get_pending_events(&self) -> &Vec<WindowEvent>
pub fn get_mut_pending_events(&mut self) -> &mut Vec<WindowEvent>
pub fn set_pending_events(&mut self, val: Vec<WindowEvent>) -> &mut Self
pub fn get_mut_clipboard_cache(&mut self) -> &mut Option<String>
pub fn set_clipboard_cache(&mut self, val: Option<String>) -> &mut Self
pub fn get_mut_pump_paused(&mut self) -> &mut bool
Trait Implementations§
Source§impl Clone for LinuxPlatform
impl Clone for LinuxPlatform
Source§impl Debug for LinuxPlatform
impl Debug for LinuxPlatform
Source§impl Default for LinuxPlatform
Default initialization for LinuxPlatform.
impl Default for LinuxPlatform
Default initialization for LinuxPlatform.
Source§impl PlatformBackend for LinuxPlatform
PlatformBackend implementation for native Linux.
impl PlatformBackend for LinuxPlatform
PlatformBackend implementation for native Linux.
Source§fn kind(&self) -> PlatformKind
fn kind(&self) -> PlatformKind
Source§fn capabilities(&self) -> PlatformCapabilities
fn capabilities(&self) -> PlatformCapabilities
Source§fn create_window(
&mut self,
config: &WindowConfig,
) -> Result<WindowState, PlatformError>
fn create_window( &mut self, config: &WindowConfig, ) -> Result<WindowState, PlatformError>
Source§fn window_state(&self, id: WindowId) -> Option<WindowState>
fn window_state(&self, id: WindowId) -> Option<WindowState>
Source§fn raw_window_handle(&self, id: WindowId) -> RawWindowHandle
fn raw_window_handle(&self, id: WindowId) -> RawWindowHandle
Source§fn poll_events(&mut self) -> Vec<WindowEvent>
fn poll_events(&mut self) -> Vec<WindowEvent>
Source§fn wait_for_events(&mut self) -> Vec<WindowEvent>
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)
fn set_frame_pump_paused(&mut self, paused: bool)
Updates Linux background frame-pump pause state.
§Arguments
&Self- Mutable Linux platform.bool-truewhen paused in background;falsewhen active.
Source§fn is_frame_pump_paused(&self) -> bool
fn is_frame_pump_paused(&self) -> bool
Source§fn present_framebuffer(
&mut self,
id: WindowId,
framebuffer: &Framebuffer,
) -> Result<(), PlatformError>
fn present_framebuffer( &mut self, id: WindowId, framebuffer: &Framebuffer, ) -> Result<(), PlatformError>
Source§fn present_framebuffer_region(
&mut self,
id: WindowId,
framebuffer: &Framebuffer,
damage: DamageRegion,
) -> Result<(), PlatformError>
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>
fn read_clipboard(&self) -> Option<String>
Source§fn write_clipboard(&mut self, text: &str) -> Result<(), PlatformError>
fn write_clipboard(&mut self, text: &str) -> Result<(), PlatformError>
Source§fn system_theme(&self) -> ThemeMode
fn system_theme(&self) -> ThemeMode
Source§impl WindowController for LinuxPlatform
WindowController implementation for Linux X11 / Wayland.
impl WindowController for LinuxPlatform
WindowController implementation for Linux X11 / Wayland.