Initial support for idle notify and idle ihibit
This commit is contained in:
parent
c4fc91d6e9
commit
19ba568f02
6 changed files with 85 additions and 3 deletions
19
src/wayland/handlers/idle_inhibit.rs
Normal file
19
src/wayland/handlers/idle_inhibit.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
use smithay::{
|
||||
delegate_idle_inhibit, reexports::wayland_server::protocol::wl_surface::WlSurface,
|
||||
wayland::idle_inhibit::IdleInhibitHandler,
|
||||
};
|
||||
|
||||
use crate::state::State;
|
||||
|
||||
impl IdleInhibitHandler for State {
|
||||
fn inhibit(&mut self, surface: WlSurface) {
|
||||
self.common.idle_inhibiting_surfaces.insert(surface);
|
||||
self.common.idle_notifier_state.set_is_inhibited(true);
|
||||
}
|
||||
|
||||
fn uninhibit(&mut self, surface: WlSurface) {
|
||||
self.common.idle_inhibiting_surfaces.remove(&surface);
|
||||
self.common.refresh_idle_inhibit();
|
||||
}
|
||||
}
|
||||
delegate_idle_inhibit!(State);
|
||||
Loading…
Add table
Add a link
Reference in a new issue