pub struct LayerShellManager { /* private fields */ }Expand description
Layer shell manager.
Tracks all layer surfaces and computes exclusive zones for the output.
Implementations§
Source§impl LayerShellManager
impl LayerShellManager
Sourcepub fn create_surface(
&mut self,
surface_id: u32,
layer: Layer,
namespace: &[u8],
) -> Result<u32, KernelError>
pub fn create_surface( &mut self, surface_id: u32, layer: Layer, namespace: &[u8], ) -> Result<u32, KernelError>
Create a new layer surface.
Returns the layer surface ID assigned by the manager.
Sourcepub fn destroy_surface(&mut self, id: u32) -> Result<(), KernelError>
pub fn destroy_surface(&mut self, id: u32) -> Result<(), KernelError>
Destroy a layer surface.
Sourcepub fn get_surface(&self, id: u32) -> Option<&LayerSurface>
pub fn get_surface(&self, id: u32) -> Option<&LayerSurface>
Get a reference to a layer surface.
Sourcepub fn get_surface_mut(&mut self, id: u32) -> Option<&mut LayerSurface>
pub fn get_surface_mut(&mut self, id: u32) -> Option<&mut LayerSurface>
Get a mutable reference to a layer surface.
Sourcepub fn configure_surface(
&mut self,
id: u32,
width: u32,
height: u32,
) -> Result<u32, KernelError>
pub fn configure_surface( &mut self, id: u32, width: u32, height: u32, ) -> Result<u32, KernelError>
Configure a layer surface with its actual dimensions and send a configure serial to the client.
Returns the serial number to be sent in the configure event.
Sourcepub fn ack_configure(&mut self, id: u32, serial: u32) -> bool
pub fn ack_configure(&mut self, id: u32, serial: u32) -> bool
Handle ack_configure from the client.
Sourcepub fn get_surfaces_for_layer(&self, layer: Layer) -> Vec<&LayerSurface>
pub fn get_surfaces_for_layer(&self, layer: Layer) -> Vec<&LayerSurface>
Get all layer surfaces belonging to a specific layer, sorted by creation order.
Sourcepub fn calculate_exclusive_zones(&self) -> (i32, i32, i32, i32)
pub fn calculate_exclusive_zones(&self) -> (i32, i32, i32, i32)
Calculate the total exclusive zone offsets for an output.
Returns (top, bottom, left, right) pixel offsets that normal windows should respect.
Sourcepub fn get_usable_area(
&self,
output_width: u32,
output_height: u32,
) -> UsableArea
pub fn get_usable_area( &self, output_width: u32, output_height: u32, ) -> UsableArea
Compute the usable area after subtracting all exclusive zones from the full output dimensions.
Sourcepub fn surface_count(&self) -> usize
pub fn surface_count(&self) -> usize
Return the total number of layer surfaces.