portable-service: little fix

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2022-11-16 13:15:05 +08:00
parent 9b3a3bde39
commit 2a65d948aa
3 changed files with 9 additions and 9 deletions

@ -387,7 +387,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Show RustDesk", "Pokaż RustDesk"), ("Show RustDesk", "Pokaż RustDesk"),
("This PC", "Ten komputer"), ("This PC", "Ten komputer"),
("or", "albo"), ("or", "albo"),
("Continue with", "Kontynuuj z"),""), ("Continue with", "Kontynuuj z"),
("Elevate", ""), ("Elevate", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

@ -280,13 +280,6 @@ fn get_modifier_state(key: Key, en: &mut Enigo) -> bool {
} }
pub fn handle_mouse(evt: &MouseEvent, conn: i32) { pub fn handle_mouse(evt: &MouseEvent, conn: i32) {
#[cfg(target_os = "macos")]
if !*IS_SERVER {
// having GUI, run main GUI thread, otherwise crash
let evt = evt.clone();
QUEUE.exec_async(move || handle_mouse_(&evt, conn));
return;
}
if !active_mouse_(conn) { if !active_mouse_(conn) {
return; return;
} }
@ -300,6 +293,13 @@ pub fn handle_mouse(evt: &MouseEvent, conn: i32) {
y: evt.y, y: evt.y,
}; };
} }
#[cfg(target_os = "macos")]
if !*IS_SERVER {
// having GUI, run main GUI thread, otherwise crash
let evt = evt.clone();
QUEUE.exec_async(move || handle_mouse_(&evt));
return;
}
#[cfg(windows)] #[cfg(windows)]
crate::portable_service::client::handle_mouse(evt); crate::portable_service::client::handle_mouse(evt);
#[cfg(not(windows))] #[cfg(not(windows))]

@ -16,7 +16,7 @@ use std::{
mem::size_of, mem::size_of,
ops::{Deref, DerefMut}, ops::{Deref, DerefMut},
sync::{Arc, Mutex}, sync::{Arc, Mutex},
time::{Duration, Instant}, time::Duration,
}; };
use winapi::{ use winapi::{
shared::minwindef::{BOOL, FALSE, TRUE}, shared::minwindef::{BOOL, FALSE, TRUE},