TODO remove closed windows from dock on update

This commit is contained in:
Ashley Wulber 2021-12-23 13:07:12 -05:00
parent 677a9e4f5c
commit 66c5574498

View file

@ -64,7 +64,7 @@ fn spawn_launcher(tx: Sender<Event>) -> Connection {
if let Ok(reply) = m.body::<Vec<Item>>() {
let _ = sender.send(Event::WindowList(reply)).await;
}
Timer::after(Duration::from_millis(200)).await;
Timer::after(Duration::from_millis(10000)).await;
}
}
});
@ -145,10 +145,11 @@ fn main() {
let mut cached_results = cached_results.as_mut();
results.sort_by(|a, b| a.name.cmp(&b.name));
// dbg!(&results);
// dbg!(&cached_results);
dbg!(&results);
dbg!(&cached_results);
// // check if cache equals the new polled results
// skip if equal
// TODO removed closed apps from the models
if cached_results.len() == results.len()
&& results.iter().zip(cached_results.iter()).fold(
0,