Merge pull request #4278 from fufesou/fix/cursor_active_portable_service

fix cursor active, portable service
This commit is contained in:
RustDesk 2023-05-05 23:26:57 +08:00 committed by GitHub
commit 1a3c6ce254
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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. // Update time to avoid send cursor position event to the peer.
// See `run_pos` --> `set_cursor_position` --> `exclude` // See `run_pos` --> `set_cursor_position` --> `exclude`
#[inline] #[inline]
pub fn update_latest_input_cursor_time() { pub fn update_latest_input_cursor_time(conn: i32) {
LATEST_PEER_INPUT_CURSOR.lock().unwrap().time = get_time(); 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] #[inline]

View File

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