state: deduplicate inhibitor code
This commit is contained in:
parent
603ed6852f
commit
48852f45ff
2 changed files with 11 additions and 6 deletions
|
|
@ -43,11 +43,13 @@ impl ZwpIdleInhibitorV1 {
|
|||
}
|
||||
|
||||
pub fn activate(self: &Rc<Self>) {
|
||||
self.client.state.idle.add_inhibitor(self);
|
||||
let state = &self.client.state;
|
||||
state.idle.add_inhibitor(self);
|
||||
}
|
||||
|
||||
pub fn deactivate(&self) {
|
||||
self.client.state.idle.remove_inhibitor(self);
|
||||
let state = &self.client.state;
|
||||
state.idle.remove_inhibitor(self);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue