diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index 2f3280c52..e8e17b5cc 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -400,9 +400,9 @@ pub fn session_enter_or_leave(_session_id: SessionID, _enter: bool) -> SyncRetur let keyboard_mode = session.get_keyboard_mode(); if _enter { set_cur_session_id_(_session_id, &keyboard_mode); - session.enter(&keyboard_mode); + session.enter(keyboard_mode); } else { - session.leave(&keyboard_mode); + session.leave(keyboard_mode); } } SyncReturn(()) diff --git a/src/ui/remote.rs b/src/ui/remote.rs index 4ec0d5a5c..95ea977e2 100644 --- a/src/ui/remote.rs +++ b/src/ui/remote.rs @@ -409,8 +409,8 @@ impl sciter::EventHandler for SciterSession { fn login(String, String, String, bool); fn new_rdp(); fn send_mouse(i32, i32, i32, bool, bool, bool, bool); - fn enter(); - fn leave(); + fn enter(String); + fn leave(String); fn ctrl_alt_del(); fn transfer_file(); fn tunnel(); diff --git a/src/ui/remote.tis b/src/ui/remote.tis index 2ed436833..e9694ccc2 100644 --- a/src/ui/remote.tis +++ b/src/ui/remote.tis @@ -273,12 +273,12 @@ function handler.onMouse(evt) case Event.MOUSE_ENTER: entered = true; stdout.println("enter"); - handler.enter(); + handler.enter(handler.get_keyboard_mode()); return keyboard_enabled; case Event.MOUSE_LEAVE: entered = false; stdout.println("leave"); - handler.leave(); + handler.leave(handler.get_keyboard_mode()); if (is_left_down && handler.peer_platform() == "Android") { is_left_down = false; handler.send_mouse((1 << 3) | 2, 0, 0, evt.altKey, diff --git a/src/ui_session_interface.rs b/src/ui_session_interface.rs index 7072f75ec..34ab6e775 100644 --- a/src/ui_session_interface.rs +++ b/src/ui_session_interface.rs @@ -572,15 +572,15 @@ impl Session { } #[cfg(not(any(target_os = "android", target_os = "ios")))] - pub fn enter(&self, keyboard_mode: &str) { + pub fn enter(&self, keyboard_mode: String) { IS_IN.store(true, Ordering::SeqCst); - keyboard::client::change_grab_status(GrabState::Run, keyboard_mode); + keyboard::client::change_grab_status(GrabState::Run, &keyboard_mode); } #[cfg(not(any(target_os = "android", target_os = "ios")))] - pub fn leave(&self, keyboard_mode: &str) { + pub fn leave(&self, keyboard_mode: String) { IS_IN.store(false, Ordering::SeqCst); - keyboard::client::change_grab_status(GrabState::Wait, keyboard_mode); + keyboard::client::change_grab_status(GrabState::Wait, &keyboard_mode); } // flutter only TODO new input