all key/mouse in QUEUE since --server has GUI too (--tray)

This commit is contained in:
rustdesk
2025-05-17 14:40:44 +08:00
parent 4f6ae08110
commit 9217205229

View File

@@ -701,8 +701,8 @@ fn get_modifier_state(key: Key, en: &mut Enigo) -> bool {
pub fn handle_mouse(evt: &MouseEvent, conn: i32) {
#[cfg(target_os = "macos")]
if !is_server() {
// having GUI, run main GUI thread, otherwise crash
{
// having GUI (--server has tray, it is GUI too), run main GUI thread, otherwise crash
let evt = evt.clone();
QUEUE.exec_async(move || handle_mouse_(&evt, conn));
return;
@@ -716,7 +716,7 @@ pub fn handle_mouse(evt: &MouseEvent, conn: i32) {
// to-do: merge handle_mouse and handle_pointer
pub fn handle_pointer(evt: &PointerDeviceEvent, 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_pointer_(&evt, conn));
@@ -1215,11 +1215,7 @@ fn reset_input() {
#[cfg(target_os = "macos")]
pub fn reset_input_ondisconn() {
if !is_server() {
QUEUE.exec_async(reset_input);
} else {
reset_input();
}
QUEUE.exec_async(reset_input);
}
fn sim_rdev_rawkey_position(code: KeyCode, keydown: bool) {