1
0
Fork 0
forked from wry/wry

config: add on_idle

This commit is contained in:
Julian Orth 2022-07-21 20:25:23 +02:00
parent ce567b9999
commit 0e5b1b5e35
5 changed files with 25 additions and 0 deletions

View file

@ -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 {

View file

@ -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;
}