@@ -701,8 +701,8 @@ fn get_modifier_state(key: Key, en: &mut Enigo) -> bool {
701701
702702pub fn handle_mouse ( evt : & MouseEvent , conn : i32 ) {
703703 #[ cfg( target_os = "macos" ) ]
704- if ! is_server ( ) {
705- // having GUI, run main GUI thread, otherwise crash
704+ {
705+ // having GUI (--server has tray, it is GUI too) , run main GUI thread, otherwise crash
706706 let evt = evt. clone ( ) ;
707707 QUEUE . exec_async ( move || handle_mouse_ ( & evt, conn) ) ;
708708 return ;
@@ -716,7 +716,7 @@ pub fn handle_mouse(evt: &MouseEvent, conn: i32) {
716716// to-do: merge handle_mouse and handle_pointer
717717pub fn handle_pointer ( evt : & PointerDeviceEvent , conn : i32 ) {
718718 #[ cfg( target_os = "macos" ) ]
719- if ! is_server ( ) {
719+ {
720720 // having GUI, run main GUI thread, otherwise crash
721721 let evt = evt. clone ( ) ;
722722 QUEUE . exec_async ( move || handle_pointer_ ( & evt, conn) ) ;
@@ -1215,11 +1215,7 @@ fn reset_input() {
12151215
12161216#[ cfg( target_os = "macos" ) ]
12171217pub fn reset_input_ondisconn ( ) {
1218- if !is_server ( ) {
1219- QUEUE . exec_async ( reset_input) ;
1220- } else {
1221- reset_input ( ) ;
1222- }
1218+ QUEUE . exec_async ( reset_input) ;
12231219}
12241220
12251221fn sim_rdev_rawkey_position ( code : KeyCode , keydown : bool ) {
0 commit comments