1
0
Fork 0
forked from wry/wry

control-center: add idle pane

This commit is contained in:
Julian Orth 2026-03-07 13:50:26 +01:00
parent eb917648c1
commit ba044793dc
7 changed files with 101 additions and 18 deletions

View file

@ -68,14 +68,14 @@ impl JayIdleRequestHandler for JayIdle {
fn set_interval(&self, req: SetInterval, _slf: &Rc<Self>) -> Result<(), Self::Error> {
let interval = Duration::from_secs(req.interval);
let state = &self.client.state;
state.idle.set_timeout(interval);
state.idle.set_timeout(state, interval);
Ok(())
}
fn set_grace_period(&self, req: SetGracePeriod, _slf: &Rc<Self>) -> Result<(), Self::Error> {
let period = Duration::from_secs(req.period);
let state = &self.client.state;
state.idle.set_grace_period(period);
state.idle.set_grace_period(state, period);
Ok(())
}
}

View file

@ -44,12 +44,12 @@ impl ZwpIdleInhibitorV1 {
pub fn activate(self: &Rc<Self>) {
let state = &self.client.state;
state.idle.add_inhibitor(self);
state.idle.add_inhibitor(state, self);
}
pub fn deactivate(&self) {
let state = &self.client.state;
state.idle.remove_inhibitor(self);
state.idle.remove_inhibitor(state, self);
}
}