pub struct IdleInhibitManager { /* private fields */ }Expand description
Manages idle inhibitors and queries the global idle-inhibited state.
Implementations§
Source§impl IdleInhibitManager
impl IdleInhibitManager
Sourcepub fn create_inhibitor(&mut self, surface_id: u32) -> Result<u32, KernelError>
pub fn create_inhibitor(&mut self, surface_id: u32) -> Result<u32, KernelError>
Create a new inhibitor for the specified surface.
Returns the inhibitor ID assigned by the manager.
Sourcepub fn destroy_inhibitor(&mut self, id: u32) -> Result<(), KernelError>
pub fn destroy_inhibitor(&mut self, id: u32) -> Result<(), KernelError>
Destroy an inhibitor by its object ID.
Sourcepub fn remove_inhibitors_for_surface(&mut self, surface_id: u32) -> usize
pub fn remove_inhibitors_for_surface(&mut self, surface_id: u32) -> usize
Remove all inhibitors associated with a specific surface.
Called when a surface is destroyed to clean up its inhibitors. Returns the number of inhibitors removed.
Sourcepub fn is_idle_inhibited(&self) -> bool
pub fn is_idle_inhibited(&self) -> bool
Check whether idle should be inhibited.
Returns true if at least one active inhibitor exists. In a full
implementation, this would also check whether the inhibitor’s
surface is currently visible/mapped.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Get the number of active inhibitors.
Sourcepub fn get_inhibitor(&self, id: u32) -> Option<&IdleInhibitor>
pub fn get_inhibitor(&self, id: u32) -> Option<&IdleInhibitor>
Get a reference to a specific inhibitor.
Sourcepub fn inhibitor_count(&self) -> usize
pub fn inhibitor_count(&self) -> usize
Total number of inhibitors (active and inactive).