possible fix of mac crash

This commit is contained in:
rustdesk 2021-05-20 17:19:37 +08:00
parent c5032f617b
commit 9a4786adb2

View File

@ -188,6 +188,17 @@ fn modifier_sleep() {
}
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;
}
handle_mouse_(evt, conn);
}
fn handle_mouse_(evt: &MouseEvent, conn: i32) {
#[cfg(windows)]
crate::platform::windows::try_change_desktop();
let buttons = evt.mask >> 3;