Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

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

rustdesk9217205229e3
diff --git a/src/server/input_service.rs b/src/server/input_service.rs
index 3a5f8d20b..bd2897190 100644
--- a/src/server/input_service.rs
+++ b/src/server/input_service.rs
@@ -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) {