fix cursor active in portable service, update peer input cursor time

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-05-05 20:16:54 +08:00
parent 5dc83359a5
commit 3aabd8f5ae
2 changed files with 6 additions and 0 deletions

View File

@ -671,6 +671,11 @@ fn fix_modifiers(modifiers: &[EnumOrUnknown<ControlKey>], en: &mut Enigo, ck: i3
}
}
#[inline]
pub fn update_latest_input_cursor_time() {
LATEST_PEER_INPUT_CURSOR.lock().unwrap().time = get_time();
}
#[inline]
fn get_last_input_cursor_pos() -> (i32, i32) {
let lock = LATEST_PEER_INPUT_CURSOR.lock().unwrap();

View File

@ -903,6 +903,7 @@ pub mod client {
pub fn handle_mouse(evt: &MouseEvent, conn: i32) {
if RUNNING.lock().unwrap().clone() {
crate::input_service::update_latest_input_cursor_time();
handle_mouse_(evt, conn).ok();
} else {
crate::input_service::handle_mouse_(evt, conn);