mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-11 20:41:29 +03:00
all key/mouse in QUEUE since --server has GUI too (--tray)
This commit is contained in:
@@ -701,8 +701,8 @@ 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")]
|
#[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();
|
let evt = evt.clone();
|
||||||
QUEUE.exec_async(move || handle_mouse_(&evt, conn));
|
QUEUE.exec_async(move || handle_mouse_(&evt, conn));
|
||||||
return;
|
return;
|
||||||
@@ -716,7 +716,7 @@ pub fn handle_mouse(evt: &MouseEvent, conn: i32) {
|
|||||||
// to-do: merge handle_mouse and handle_pointer
|
// to-do: merge handle_mouse and handle_pointer
|
||||||
pub fn handle_pointer(evt: &PointerDeviceEvent, conn: i32) {
|
pub fn handle_pointer(evt: &PointerDeviceEvent, conn: i32) {
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
if !is_server() {
|
{
|
||||||
// having GUI, run main GUI thread, otherwise crash
|
// having GUI, run main GUI thread, otherwise crash
|
||||||
let evt = evt.clone();
|
let evt = evt.clone();
|
||||||
QUEUE.exec_async(move || handle_pointer_(&evt, conn));
|
QUEUE.exec_async(move || handle_pointer_(&evt, conn));
|
||||||
@@ -1215,11 +1215,7 @@ fn reset_input() {
|
|||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
pub fn reset_input_ondisconn() {
|
pub fn reset_input_ondisconn() {
|
||||||
if !is_server() {
|
QUEUE.exec_async(reset_input);
|
||||||
QUEUE.exec_async(reset_input);
|
|
||||||
} else {
|
|
||||||
reset_input();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sim_rdev_rawkey_position(code: KeyCode, keydown: bool) {
|
fn sim_rdev_rawkey_position(code: KeyCode, keydown: bool) {
|
||||||
|
|||||||
Reference in New Issue
Block a user