Skip to content

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

Merge branch 'ios_1.2.2'

rustdesk5b802e9eddc1
diff --cc flutter/lib/models/server_model.dart
index 9fb91f463,e3c8f4c49..00c5490e0
--- a/flutter/lib/models/server_model.dart
+++ b/flutter/lib/models/server_model.dart
@@@ -61,8 -58,13 +59,11 @@@ class ServerModel with ChangeNotifier
bool get showElevation => _showElevation;
- bool get hideCm => _hideCm;
-
int get connectStatus => _connectStatus;
+ TextEditingController get _serverPasswd =>
+ TextEditingController(text: translate("Generating ..."));
+
String get verificationMethod {
final index = [
kUseTemporaryPassword,
diff --cc flutter/pubspec.yaml
index b7141455d,3ff117dba..691f86066
--- a/flutter/pubspec.yaml
+++ b/flutter/pubspec.yaml
@@@ -16,7 -16,7 +16,7 @@@ publish_to: "none" # Remove this line i
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# 1.1.9-1 works for android, but for ios it becomes 1.1.91, need to set it to 1.1.9-a.1 for iOS, will get 1.1.9.1, but iOS store not allow 4 numbers
- version: 1.2.3
-version: 1.2.2+38
++version: 1.2.3+39
environment:
sdk: ">=2.17.0"
diff --cc src/flutter.rs
index af9580587,2c9b7690b..f9434d98f
--- a/src/flutter.rs
+++ b/src/flutter.rs
@@@ -1132,88 -1124,6 +1126,85 @@@ pub fn stop_global_event_stream(app_typ
let _ = GLOBAL_EVENT_STREAM.write().unwrap().remove(&app_type);
}
+#[inline]
+fn session_send_touch_scale(
+ session_id: SessionID,
+ v: &serde_json::Value,
+ alt: bool,
+ ctrl: bool,
+ shift: bool,
+ command: bool,
+) {
+ match v.get("v").and_then(|s| s.as_i64()) {
+ Some(scale) => {
+ if let Some(session) = SESSIONS.read().unwrap().get(&session_id) {
+ session.send_touch_scale(scale as _, alt, ctrl, shift, command);
+ }
+ }
+ None => {}
+ }
+}
+
+#[inline]
+fn session_send_touch_pan(
+ session_id: SessionID,
+ v: &serde_json::Value,
+ pan_event: &str,
+ alt: bool,
+ ctrl: bool,
+ shift: bool,
+ command: bool,
+) {
+ match v.get("v") {
+ Some(v) => match (
+ v.get("x").and_then(|x| x.as_i64()),
+ v.get("y").and_then(|y| y.as_i64()),
+ ) {
+ (Some(x), Some(y)) => {
+ if let Some(session) = SESSIONS.read().unwrap().get(&session_id) {
+ session
+ .send_touch_pan_event(pan_event, x as _, y as _, alt, ctrl, shift, command);
+ }
+ }
+ _ => {}
+ },
+ _ => {}
+ }
+}
+
+fn session_send_touch_event(
+ session_id: SessionID,
+ v: &serde_json::Value,
+ alt: bool,
+ ctrl: bool,
+ shift: bool,
+ command: bool,
+) {
+ match v.get("t").and_then(|t| t.as_str()) {
+ Some("scale") => session_send_touch_scale(session_id, v, alt, ctrl, shift, command),
+ Some(pan_event) => {
+ session_send_touch_pan(session_id, v, pan_event, alt, ctrl, shift, command)
+ }
+ _ => {}
+ }
+}
+
+pub fn session_send_pointer(session_id: SessionID, msg: String) {
+ if let Ok(m) = serde_json::from_str::<HashMap<String, serde_json::Value>>(&msg) {
+ let alt = m.get("alt").is_some();
+ let ctrl = m.get("ctrl").is_some();
+ let shift = m.get("shift").is_some();
+ let command = m.get("command").is_some();
+ match (m.get("k"), m.get("v")) {
+ (Some(k), Some(v)) => match k.as_str() {
+ Some("touch") => session_send_touch_event(session_id, v, alt, ctrl, shift, command),
+ _ => {}
+ },
+ _ => {}
+ }
+ }
+}
+
- #[no_mangle]
- unsafe extern "C" fn get_rgba() {}
-
/// Hooks for session.
#[derive(Clone)]
pub enum SessionHook {