pub struct XWaylandServer { /* private fields */ }Expand description
XWayland compatibility server.
Manages the lifecycle of the XWayland process and maintains the mapping between X11 window IDs and Wayland surface IDs.
Implementations§
Source§impl XWaylandServer
impl XWaylandServer
Sourcepub fn with_display(display: u32) -> Self
pub fn with_display(display: u32) -> Self
Create a new XWayland server with a specific display number.
Sourcepub fn start(&mut self) -> Result<(), KernelError>
pub fn start(&mut self) -> Result<(), KernelError>
Start the XWayland server.
In this stub implementation, this creates the socket directory structure and transitions to the Running state. Actual XWayland process spawning is deferred to Phase 8.
Sourcepub fn stop(&mut self) -> Result<(), KernelError>
pub fn stop(&mut self) -> Result<(), KernelError>
Stop the XWayland server.
Sourcepub fn state(&self) -> XWaylandState
pub fn state(&self) -> XWaylandState
Get the current server state.
Sourcepub fn display_number(&self) -> u32
pub fn display_number(&self) -> u32
Get the display number.
Sourcepub fn socket_path(&self) -> &str
pub fn socket_path(&self) -> &str
Get the socket path.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the server is running.
Sourcepub fn create_window_mapping(
&mut self,
wayland_surface_id: u32,
) -> Result<u32, KernelError>
pub fn create_window_mapping( &mut self, wayland_surface_id: u32, ) -> Result<u32, KernelError>
Create a new X11-to-Wayland window mapping.
Called when XWayland creates a new X11 window and its corresponding Wayland surface.
Sourcepub fn destroy_window_mapping(
&mut self,
x11_window_id: u32,
) -> Result<(), KernelError>
pub fn destroy_window_mapping( &mut self, x11_window_id: u32, ) -> Result<(), KernelError>
Destroy a window mapping by X11 window ID.
Sourcepub fn get_surface_for_x11_window(&self, x11_window_id: u32) -> Option<u32>
pub fn get_surface_for_x11_window(&self, x11_window_id: u32) -> Option<u32>
Get the Wayland surface ID for an X11 window.
Sourcepub fn get_x11_window_for_surface(&self, wayland_surface_id: u32) -> Option<u32>
pub fn get_x11_window_for_surface(&self, wayland_surface_id: u32) -> Option<u32>
Get the X11 window ID for a Wayland surface.
Sourcepub fn get_window_mapping(
&self,
x11_window_id: u32,
) -> Option<&X11WindowMapping>
pub fn get_window_mapping( &self, x11_window_id: u32, ) -> Option<&X11WindowMapping>
Get a reference to a window mapping.
Sourcepub fn get_window_mapping_mut(
&mut self,
x11_window_id: u32,
) -> Option<&mut X11WindowMapping>
pub fn get_window_mapping_mut( &mut self, x11_window_id: u32, ) -> Option<&mut X11WindowMapping>
Get a mutable reference to a window mapping.
Sourcepub fn get_all_mappings(&self) -> &[X11WindowMapping]
pub fn get_all_mappings(&self) -> &[X11WindowMapping]
Get all active window mappings.
Sourcepub fn window_count(&self) -> usize
pub fn window_count(&self) -> usize
Get the number of active window mappings.
Sourcepub fn handle_x11_event(&mut self, event: &X11Event) -> Result<(), KernelError>
pub fn handle_x11_event(&mut self, event: &X11Event) -> Result<(), KernelError>
Handle an X11 event from the XWayland process.
In the stub implementation, this updates internal mappings. In Phase 8, this would translate X11 events to Wayland compositor actions.
Sourcepub fn find_free_display() -> Result<u32, KernelError>
pub fn find_free_display() -> Result<u32, KernelError>
Find a free display number by checking for existing lock files.
Returns the first available display number, or an error if all display numbers up to MAX_DISPLAY are taken.
Sourcepub fn display_string(&self) -> String
pub fn display_string(&self) -> String
Get the DISPLAY environment variable string for this server.
Returns a string like “:0” that X11 clients use to connect.