pub struct WindowManager { /* private fields */ }Expand description
Window Manager
Implementations§
Source§impl WindowManager
impl WindowManager
Sourcepub fn create_window(
&self,
x: i32,
y: i32,
width: u32,
height: u32,
owner_pid: u64,
) -> Result<WindowId, KernelError>
pub fn create_window( &self, x: i32, y: i32, width: u32, height: u32, owner_pid: u64, ) -> Result<WindowId, KernelError>
Create a new window
Sourcepub fn destroy_window(&self, window_id: WindowId) -> Result<(), KernelError>
pub fn destroy_window(&self, window_id: WindowId) -> Result<(), KernelError>
Destroy a window
Sourcepub fn move_window(
&self,
window_id: WindowId,
x: i32,
y: i32,
) -> Result<(), KernelError>
pub fn move_window( &self, window_id: WindowId, x: i32, y: i32, ) -> Result<(), KernelError>
Move a window
Sourcepub fn resize_window(
&self,
window_id: WindowId,
width: u32,
height: u32,
) -> Result<(), KernelError>
pub fn resize_window( &self, window_id: WindowId, width: u32, height: u32, ) -> Result<(), KernelError>
Resize a window
Sourcepub fn focus_window(&self, window_id: WindowId) -> Result<(), KernelError>
pub fn focus_window(&self, window_id: WindowId) -> Result<(), KernelError>
Focus a window
Sourcepub fn window_at_position(&self, x: i32, y: i32) -> Option<WindowId>
pub fn window_at_position(&self, x: i32, y: i32) -> Option<WindowId>
Get window at position
Sourcepub fn process_input(&self, event: InputEvent)
pub fn process_input(&self, event: InputEvent)
Process input event
Sourcepub fn queue_event(&self, event: WindowEvent)
pub fn queue_event(&self, event: WindowEvent)
Queue an event for delivery
Sourcepub fn get_events(&self, window_id: WindowId) -> Vec<InputEvent>
pub fn get_events(&self, window_id: WindowId) -> Vec<InputEvent>
Get pending events for a window
Sourcepub fn set_window_title(&self, window_id: WindowId, title: &str)
pub fn set_window_title(&self, window_id: WindowId, title: &str)
Set a window’s title.
Sourcepub fn get_window(&self, window_id: WindowId) -> Option<Window>
pub fn get_window(&self, window_id: WindowId) -> Option<Window>
Get a clone of a window by ID.
Sourcepub fn get_focused_window_id(&self) -> Option<WindowId>
pub fn get_focused_window_id(&self) -> Option<WindowId>
Get the currently focused window ID.
Sourcepub fn get_all_windows(&self) -> Vec<Window>
pub fn get_all_windows(&self) -> Vec<Window>
Get all windows
Sourcepub fn get_visible_windows(&self) -> Vec<Window>
pub fn get_visible_windows(&self) -> Vec<Window>
Get all visible windows on the active workspace, ordered by z-order (bottom to top – last element is the topmost window).
Sourcepub fn set_screen_size(&self, width: u32, height: u32)
pub fn set_screen_size(&self, width: u32, height: u32)
Set the screen dimensions (called when display is configured)
Sourcepub fn set_placement_heuristic(&self, heuristic: PlacementHeuristic)
pub fn set_placement_heuristic(&self, heuristic: PlacementHeuristic)
Set the window placement heuristic
Sourcepub fn place_window(&self, window_id: WindowId) -> (i32, i32)
pub fn place_window(&self, window_id: WindowId) -> (i32, i32)
Compute the placement position for a window based on the current heuristic.
The window must already be inserted into self.windows so its
dimensions can be read. Returns (x, y) for the top-left corner.
Sourcepub fn snap_window(&self, window_id: WindowId, zone: SnapZone)
pub fn snap_window(&self, window_id: WindowId, zone: SnapZone)
Snap a window to a screen zone (half, quarter, or maximize).
Saves the window’s current geometry so it can be restored later.
Sourcepub fn detect_snap_zone(
x: i32,
y: i32,
screen_w: u32,
screen_h: u32,
) -> SnapZone
pub fn detect_snap_zone( x: i32, y: i32, screen_w: u32, screen_h: u32, ) -> SnapZone
Detect which snap zone a screen coordinate falls in.
Returns SnapZone::None if the position is not within the edge
threshold (8 pixels).
Sourcepub fn tile_windows(&self, layout: TileLayout)
pub fn tile_windows(&self, layout: TileLayout)
Tile all visible windows on the active workspace using the given layout.
Sourcepub fn set_window_opacity(&self, window_id: WindowId, opacity: u8)
pub fn set_window_opacity(&self, window_id: WindowId, opacity: u8)
Set window opacity (0 = transparent, 255 = opaque)
Sourcepub fn switch_workspace(&self, workspace_id: WorkspaceId)
pub fn switch_workspace(&self, workspace_id: WorkspaceId)
Switch to a different workspace.
Sourcepub fn move_window_to_workspace(
&self,
window_id: WindowId,
workspace_id: WorkspaceId,
)
pub fn move_window_to_workspace( &self, window_id: WindowId, workspace_id: WorkspaceId, )
Move a window to a different workspace.
Sourcepub fn get_active_workspace(&self) -> WorkspaceId
pub fn get_active_workspace(&self) -> WorkspaceId
Get the currently active workspace ID.
Sourcepub fn get_workspace_windows(&self, workspace_id: WorkspaceId) -> Vec<WindowId>
pub fn get_workspace_windows(&self, workspace_id: WorkspaceId) -> Vec<WindowId>
Get the list of window IDs on a given workspace.
Sourcepub fn event_loop_iteration(&self)
pub fn event_loop_iteration(&self)
Event loop iteration