config: add on_idle
This commit is contained in:
parent
ce567b9999
commit
0e5b1b5e35
5 changed files with 25 additions and 0 deletions
|
|
@ -125,6 +125,10 @@ impl ConfigProxy {
|
|||
pub fn clear(&self) {
|
||||
self.send(&ServerMessage::Clear);
|
||||
}
|
||||
|
||||
pub fn idle(&self) {
|
||||
self.send(&ServerMessage::Idle);
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for ConfigProxy {
|
||||
|
|
|
|||
|
|
@ -68,6 +68,9 @@ impl Idle {
|
|||
let since = duration_since(self.last_input);
|
||||
if since >= timeout {
|
||||
if !timeout.is_zero() && !self.is_inhibited {
|
||||
if let Some(config) = self.state.config.get() {
|
||||
config.idle();
|
||||
}
|
||||
self.backend.set_idle(true);
|
||||
self.idle = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue