periodicly get cursor pos on conn

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-03-11 17:18:13 +08:00
parent 2e579d6e31
commit e77fc25836
2 changed files with 72 additions and 33 deletions

View File

@@ -541,7 +541,9 @@ impl Connection {
conn.reset_resolution();
ALIVE_CONNS.lock().unwrap().retain(|&c| c != id);
if let Some(s) = conn.server.upgrade() {
s.write().unwrap().remove_connection(&conn.inner);
let mut s = s.write().unwrap();
s.remove_connection(&conn.inner);
try_stop_record_cursor_pos();
}
log::info!("#{} connection loop exited", id);
}
@@ -948,9 +950,9 @@ impl Connection {
if !self.audio_enabled() {
noperms.push(super::audio_service::NAME);
}
s.write()
.unwrap()
.add_connection(self.inner.clone(), &noperms);
let mut s = s.write().unwrap();
s.add_connection(self.inner.clone(), &noperms);
try_start_record_cursor_pos();
}
}
}