improve cancellation

This commit is contained in:
Ferdinand Schober
2024-07-11 16:34:41 +02:00
parent f0c9290579
commit 2d26bd6a0b
5 changed files with 117 additions and 94 deletions

View File

@@ -123,15 +123,22 @@ async fn do_capture(
.await;
// FIXME DUPLICATES
// let clients = server
// .client_manager
// .borrow()
// .get_client_states()
// .map(|(h, (c, _))| (h, c.pos))
// .collect::<Vec<_>>();
// for (handle, pos) in clients {
// capture.create(handle, pos.into()).await?;
// }
let clients = server
.client_manager
.borrow()
.get_client_states()
.map(|(h, s)| (h, s.clone()))
.collect::<Vec<_>>();
log::info!("{clients:?}");
let clients = server
.client_manager
.borrow()
.get_client_states()
.map(|(h, (c, _))| (h, c.pos))
.collect::<Vec<_>>();
for (handle, pos) in clients {
capture.create(handle, pos.into()).await?;
}
let mut pressed_keys = HashSet::new();
loop {