fix cursor active, portable service

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-05-05 08:24:08 -07:00
parent a054c9520e
commit 4d16d9566a
2 changed files with 6 additions and 3 deletions

View File

@ -674,8 +674,11 @@ fn fix_modifiers(modifiers: &[EnumOrUnknown<ControlKey>], en: &mut Enigo, ck: i3
// Update time to avoid send cursor position event to the peer.
// See `run_pos` --> `set_cursor_position` --> `exclude`
#[inline]
pub fn update_latest_input_cursor_time() {
LATEST_PEER_INPUT_CURSOR.lock().unwrap().time = get_time();
pub fn update_latest_input_cursor_time(conn: i32) {
log_fo_file(&format!("update_latest_input_cursor_time process id {}", std::process::id()));
let mut lock = LATEST_PEER_INPUT_CURSOR.lock().unwrap();
lock.conn = conn;
lock.time = get_time();
}
#[inline]

View File

@ -903,7 +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();
crate::input_service::update_latest_input_cursor_time(conn);
handle_mouse_(evt, conn).ok();
} else {
crate::input_service::handle_mouse_(evt, conn);