From a2742caa87eea05645f59549df431f15f9489e69 Mon Sep 17 00:00:00 2001 From: 21pages Date: Wed, 20 Sep 2023 17:45:38 +0800 Subject: [PATCH 01/71] tags add scroll bar Signed-off-by: 21pages --- flutter/lib/common/widgets/address_book.dart | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/flutter/lib/common/widgets/address_book.dart b/flutter/lib/common/widgets/address_book.dart index bb5dc5605..14a510cec 100644 --- a/flutter/lib/common/widgets/address_book.dart +++ b/flutter/lib/common/widgets/address_book.dart @@ -1,3 +1,4 @@ +import 'package:dynamic_layouts/dynamic_layouts.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hbb/common/formatter/id_formatter.dart'; import 'package:flutter_hbb/common/widgets/peer_card.dart'; @@ -156,9 +157,13 @@ class _AddressBookState extends State { } else { tags = gFFI.abModel.tags; } - return Wrap( - children: tags - .map((e) => AddressBookTag( + return DynamicGridView.builder( + gridDelegate: SliverGridDelegateWithWrapping( + mainAxisSpacing: 0, crossAxisSpacing: 0), + itemCount: tags.length, + itemBuilder: (BuildContext context, int index) { + final e = tags[index]; + return AddressBookTag( name: e, tags: gFFI.abModel.selectedTags, onTap: () { @@ -167,9 +172,8 @@ class _AddressBookState extends State { } else { gFFI.abModel.selectedTags.add(e); } - })) - .toList(), - ); + }); + }); }); } From 428bc9b41927293dc16850ca5aa510f1d69c9463 Mon Sep 17 00:00:00 2001 From: 21pages Date: Wed, 20 Sep 2023 17:47:33 +0800 Subject: [PATCH 02/71] group users add scroll bar Signed-off-by: 21pages --- flutter/lib/common/widgets/my_group.dart | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/flutter/lib/common/widgets/my_group.dart b/flutter/lib/common/widgets/my_group.dart index a4d89155a..e73755d2f 100644 --- a/flutter/lib/common/widgets/my_group.dart +++ b/flutter/lib/common/widgets/my_group.dart @@ -148,16 +148,15 @@ class _MyGroupState extends State { Widget _buildUserContacts() { return Obx(() { - return Column( - children: gFFI.groupModel.users - .where((p0) { - if (searchUserText.isNotEmpty) { - return p0.name.contains(searchUserText.value); - } - return true; - }) - .map((e) => _buildUserItem(e)) - .toList()); + final items = gFFI.groupModel.users.where((p0) { + if (searchUserText.isNotEmpty) { + return p0.name.contains(searchUserText.value); + } + return true; + }).toList(); + return ListView.builder( + itemCount: items.length, + itemBuilder: (context, index) => _buildUserItem(items[index])); }); } From bf5f58e0ced6d280289bd82aba4ef4288fd6c95c Mon Sep 17 00:00:00 2001 From: Sahil Yeole Date: Wed, 20 Sep 2023 19:55:13 +0530 Subject: [PATCH 03/71] fix wayland cursor mismatch Signed-off-by: Sahil Yeole --- src/server/wayland.rs | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/src/server/wayland.rs b/src/server/wayland.rs index efed83936..44cf8bf4a 100644 --- a/src/server/wayland.rs +++ b/src/server/wayland.rs @@ -2,6 +2,7 @@ use super::*; use hbb_common::{allow_err, platform::linux::DISTRO}; use scrap::{is_cursor_embedded, set_map_err, Capturer, Display, Frame, TraitCapturer}; use std::io; +use std::process::{Command, Output}; use crate::client::{ SCRAP_OTHER_VERSION_OR_X11_REQUIRED, SCRAP_UBUNTU_HIGHER_REQUIRED, SCRAP_X11_REQUIRED, @@ -115,6 +116,22 @@ pub(super) fn is_inited() -> Option { } } +fn get_max_desktop_resolution() -> Option { + // works with Xwayland + let output: Output = Command::new("sh") + .arg("-c") + .arg("xrandr | awk '/current/ { print $8,$9,$10 }'") + .output() + .ok()?; + + if output.status.success() { + let result = String::from_utf8_lossy(&output.stdout); + Some(result.trim().to_string()) + } else { + None + } +} + pub(super) async fn check_init() -> ResultType<()> { if !scrap::is_x11() { let mut minx = 0; @@ -151,10 +168,20 @@ pub(super) async fn check_init() -> ResultType<()> { num_cpus::get(), ); - minx = origin.0; - maxx = origin.0 + width as i32; - miny = origin.1; - maxy = origin.1 + height as i32; + let (max_width, max_height) = match get_max_desktop_resolution() { + Some(result) if !result.is_empty() => { + let resolution: Vec<&str> = result.split(" ").collect(); + let w: i32 = resolution[0].parse().unwrap_or(origin.0 + width as i32); + let h: i32 = resolution[2].trim_end_matches(",").parse().unwrap_or(origin.1 + height as i32); + (w, h) + } + _ => (origin.0 + width as i32, origin.1 + height as i32) + }; + + minx = 0; + maxx = max_width; + miny = 0; + maxy = max_height; let capturer = Box::into_raw(Box::new( Capturer::new(display, true).with_context(|| "Failed to create capturer")?, From 492ea7264aace84f5719bfe3e613293856750885 Mon Sep 17 00:00:00 2001 From: solokot Date: Thu, 21 Sep 2023 09:11:53 +0300 Subject: [PATCH 04/71] Update ru.rs --- src/lang/ru.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/ru.rs b/src/lang/ru.rs index c9a8511fc..a6547bc8f 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -555,6 +555,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("auto_disconnect_option_tip", "Автоматически закрывать входящие сеансы при неактивности пользователя"), ("Connection failed due to inactivity", "Подключение не выполнено из-за неактивности"), ("Check for software update on startup", "Проверять обновления программы при запуске"), - ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("upgrade_rustdesk_server_pro_to_{}_tip", "Обновите RustDesk Server Pro до версии {} или новее!"), ].iter().cloned().collect(); } From 462fa5999fab2aaaa3fe60c530282700d9c30ee5 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Thu, 21 Sep 2023 16:01:43 +0800 Subject: [PATCH 05/71] update window_manager pub for cm now shown sometings on linux --- flutter/pubspec.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flutter/pubspec.lock b/flutter/pubspec.lock index 7cd9680f0..aa0ead349 100644 --- a/flutter/pubspec.lock +++ b/flutter/pubspec.lock @@ -1529,7 +1529,7 @@ packages: description: path: "." ref: HEAD - resolved-ref: "2c4b242e668acf4e652b09b13f650bcfbbaa3871" + resolved-ref: "02a95bd9674c16fe1b1d6d0db655c10fc8c270cb" url: "https://github.com/rustdesk-org/window_manager" source: git version: "0.3.4" From 51b62ea4670d9120c4bb9cfa3ab997394ae61794 Mon Sep 17 00:00:00 2001 From: 21pages Date: Thu, 21 Sep 2023 16:34:04 +0800 Subject: [PATCH 06/71] merge info from group when add id to addressbook Signed-off-by: 21pages --- flutter/lib/models/ab_model.dart | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/flutter/lib/models/ab_model.dart b/flutter/lib/models/ab_model.dart index 6968b2f10..bf638c767 100644 --- a/flutter/lib/models/ab_model.dart +++ b/flutter/lib/models/ab_model.dart @@ -132,6 +132,7 @@ class AbModel { 'alias': alias, 'tags': tags, }); + _mergePeerFromGroup(peer); peers.add(peer); } @@ -573,4 +574,18 @@ class AbModel { peers.clear(); await bind.mainClearAb(); } + + _mergePeerFromGroup(Peer p) { + final g = gFFI.groupModel.peers.firstWhereOrNull((e) => p.id == e.id); + if (g == null) return; + if (p.username.isEmpty) { + p.username = g.username; + } + if (p.hostname.isEmpty) { + p.hostname = g.hostname; + } + if (p.platform.isEmpty) { + p.platform = g.platform; + } + } } From 32a32e4a723c186bdda6cb4ec93164092fee2076 Mon Sep 17 00:00:00 2001 From: RustDesk <71636191+rustdesk@users.noreply.github.com> Date: Thu, 21 Sep 2023 19:06:04 +0800 Subject: [PATCH 07/71] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5cf17bf4d..019442872 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,9 @@ Chat with us: [Discord](https://discord.gg/nDceKgxnkV) | [Twitter](https://twitter.com/rustdesk) | [Reddit](https://www.reddit.com/r/rustdesk) -[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/I2I04VU09) +[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/I2I04VU09) + +[![Open Bounties](https://img.shields.io/endpoint?url=https%3A%2F%2Fconsole.algora.io%2Fapi%2Fshields%2Frustdesk%2Fbounties%3Fstatus%3Dopen)](https://console.algora.io/org/rustdesk/bounties?status=open) Yet another remote desktop software, written in Rust. Works out of the box, no configuration required. You have full control of your data, with no concerns about security. You can use our rendezvous/relay server, [set up your own](https://rustdesk.com/server), or [write your own rendezvous/relay server](https://github.com/rustdesk/rustdesk-server-demo). From 55b43f461217aa214bc3e8e3fe4899e1341440e5 Mon Sep 17 00:00:00 2001 From: 21pages Date: Sat, 23 Sep 2023 10:03:09 +0800 Subject: [PATCH 08/71] user search TextField horizontal align and case insensitive Signed-off-by: 21pages --- flutter/lib/common/widgets/my_group.dart | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/flutter/lib/common/widgets/my_group.dart b/flutter/lib/common/widgets/my_group.dart index e73755d2f..07de0c86a 100644 --- a/flutter/lib/common/widgets/my_group.dart +++ b/flutter/lib/common/widgets/my_group.dart @@ -120,6 +120,7 @@ class _MyGroupState extends State { } Widget _buildLeftHeader() { + final fontSize = 14.0; return Row( children: [ Expanded( @@ -128,16 +129,16 @@ class _MyGroupState extends State { onChanged: (value) { searchUserText.value = value; }, + textAlignVertical: TextAlignVertical.center, + style: TextStyle(fontSize: fontSize), decoration: InputDecoration( filled: false, prefixIcon: Icon( Icons.search_rounded, color: Theme.of(context).hintColor, - ), - contentPadding: const EdgeInsets.symmetric(vertical: 10), + ).paddingOnly(top: 2), hintText: translate("Search"), - hintStyle: - TextStyle(fontSize: 14, color: Theme.of(context).hintColor), + hintStyle: TextStyle(fontSize: fontSize), border: InputBorder.none, isDense: true, ), @@ -150,7 +151,9 @@ class _MyGroupState extends State { return Obx(() { final items = gFFI.groupModel.users.where((p0) { if (searchUserText.isNotEmpty) { - return p0.name.contains(searchUserText.value); + return p0.name + .toLowerCase() + .contains(searchUserText.value.toLowerCase()); } return true; }).toList(); From 90f0f27fcaf3c46e171ade4b5fa389bc0fcc2581 Mon Sep 17 00:00:00 2001 From: 21pages Date: Sat, 23 Sep 2023 21:06:58 +0800 Subject: [PATCH 09/71] fix file transfer affect codec selection Signed-off-by: 21pages --- src/server/connection.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/server/connection.rs b/src/server/connection.rs index 4b6b92f2b..2723b0834 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -1330,10 +1330,8 @@ impl Connection { return Config::get_option(enable_prefix_option).is_empty(); } - async fn handle_login_request_without_validation(&mut self, lr: &LoginRequest) { - self.lr = lr.clone(); + fn update_codec_on_login(&self, lr: &LoginRequest) { if let Some(o) = lr.option.as_ref() { - self.options_in_login = Some(o.clone()); if let Some(q) = o.supported_decoding.clone().take() { scrap::codec::Encoder::update( self.inner.id(), @@ -1351,6 +1349,16 @@ impl Connection { scrap::codec::EncodingUpdate::NewOnlyVP9, ); } + } + + async fn handle_login_request_without_validation(&mut self, lr: &LoginRequest) { + self.lr = lr.clone(); + if let Some(o) = lr.option.as_ref() { + self.options_in_login = Some(o.clone()); + } + if lr.union.is_none() { + self.update_codec_on_login(&lr); + } self.video_ack_required = lr.video_ack_required; } From d83d8c18fc47ea8b8a8ac6bf873916edadb36d40 Mon Sep 17 00:00:00 2001 From: 21pages Date: Sun, 24 Sep 2023 08:36:53 +0800 Subject: [PATCH 10/71] remove ab pull error toast, translate group pull error Signed-off-by: 21pages --- flutter/lib/models/ab_model.dart | 3 --- flutter/lib/models/group_model.dart | 6 ++++-- src/lang/ar.rs | 1 + src/lang/ca.rs | 1 + src/lang/cn.rs | 5 +++-- src/lang/cs.rs | 1 + src/lang/da.rs | 1 + src/lang/de.rs | 1 + src/lang/el.rs | 1 + src/lang/en.rs | 3 ++- src/lang/eo.rs | 1 + src/lang/es.rs | 1 + src/lang/fa.rs | 1 + src/lang/fr.rs | 1 + src/lang/hu.rs | 1 + src/lang/id.rs | 1 + src/lang/it.rs | 1 + src/lang/ja.rs | 1 + src/lang/ko.rs | 1 + src/lang/kz.rs | 1 + src/lang/lt.rs | 1 + src/lang/lv.rs | 1 + src/lang/nl.rs | 1 + src/lang/pl.rs | 1 + src/lang/pt_PT.rs | 1 + src/lang/ptbr.rs | 1 + src/lang/ro.rs | 1 + src/lang/ru.rs | 1 + src/lang/sk.rs | 1 + src/lang/sl.rs | 1 + src/lang/sq.rs | 1 + src/lang/sr.rs | 1 + src/lang/sv.rs | 1 + src/lang/template.rs | 1 + src/lang/th.rs | 1 + src/lang/tr.rs | 1 + src/lang/tw.rs | 1 + src/lang/ua.rs | 1 + src/lang/vn.rs | 1 + 39 files changed, 44 insertions(+), 8 deletions(-) diff --git a/flutter/lib/models/ab_model.dart b/flutter/lib/models/ab_model.dart index bf638c767..e64759f91 100644 --- a/flutter/lib/models/ab_model.dart +++ b/flutter/lib/models/ab_model.dart @@ -105,9 +105,6 @@ class AbModel { if (!quiet) { pullError.value = '${translate('pull_ab_failed_tip')}: ${translate(err.toString())}'; - if (gFFI.peerTabModel.currentTab != PeerTabIndex.ab.index) { - BotToast.showText(contentColor: Colors.red, text: pullError.value); - } } } finally { abLoading.value = false; diff --git a/flutter/lib/models/group_model.dart b/flutter/lib/models/group_model.dart index 0b2174f9f..ddb02d370 100644 --- a/flutter/lib/models/group_model.dart +++ b/flutter/lib/models/group_model.dart @@ -133,7 +133,8 @@ class GroupModel { return true; } catch (err) { debugPrint('get accessible users: $err'); - groupLoadError.value = err.toString(); + groupLoadError.value = + '${translate('pull_group_failed_tip')}: ${translate(err.toString())}'; } return false; } @@ -198,7 +199,8 @@ class GroupModel { return true; } catch (err) { debugPrint('get accessible peers: $err'); - groupLoadError.value = err.toString(); + groupLoadError.value = + '${translate('pull_group_failed_tip')}: ${translate(err.toString())}'; } return false; } diff --git a/src/lang/ar.rs b/src/lang/ar.rs index d695c2ad5..3500e2916 100644 --- a/src/lang/ar.rs +++ b/src/lang/ar.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ca.rs b/src/lang/ca.rs index a047ee501..1fd7dff11 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 989e962f3..00cdc9390 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -535,8 +535,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("List View", "列表视图"), ("Select", "选择"), ("Toggle Tags", "切换标签"), - ("pull_ab_failed_tip", "未成功获取地址簿"), - ("push_ab_failed_tip", "未成功上传地址簿"), + ("pull_ab_failed_tip", "获取地址簿失败"), + ("push_ab_failed_tip", "上传地址簿失败"), ("synced_peer_readded_tip", "最近会话中存在的设备将会被重新同步到地址簿。"), ("Change Color", "更改颜色"), ("Primary Color", "基本色"), @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "由于长时间无操作, 连接被自动断开"), ("Check for software update on startup", "启动时检查软件更新"), ("upgrade_rustdesk_server_pro_to_{}_tip", "请升级专业版服务器到{}或更高版本!"), + ("pull_group_failed_tip", "获取组信息失败"), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index fe2b9f3d7..cd7f3a306 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index b287056d1..7d1321890 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index 6bca2eefe..893882a8e 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "Automatische Trennung der Verbindung aufgrund von Inaktivität"), ("Check for software update on startup", "Beim Start auf Softwareaktualisierung prüfen"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Bitte aktualisieren Sie RustDesk Server Pro auf die Version {} oder neuer!"), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index d58d7b0ad..76327d0ea 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/en.rs b/src/lang/en.rs index 27e636a9d..7bedc3182 100644 --- a/src/lang/en.rs +++ b/src/lang/en.rs @@ -90,6 +90,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Decline", "Decline"), ("auto_disconnect_option_tip", "Automatically close incoming sessions on user inactivity"), ("Connection failed due to inactivity", "Automatically disconnected due to inactivity"), - ("upgrade_rustdesk_server_pro_to_{}_tip", "Please upgrade RustDesk Server Pro to version {} or newer!") + ("upgrade_rustdesk_server_pro_to_{}_tip", "Please upgrade RustDesk Server Pro to version {} or newer!"), + ("pull_group_failed_tip", "Failed to refresh group"), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 49fd95982..9b73932f2 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index 2ac738e4a..f3887cd8e 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "Desconectar automáticamente por inactividad."), ("Check for software update on startup", "Comprobar actualización al iniciar"), ("upgrade_rustdesk_server_pro_to_{}_tip", "¡Por favor, actualiza RustDesk Server Pro a la versión {} o superior"), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index fca9610ce..25a526377 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index fec7f5bb7..4a28ede55 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index bb6d0e2cc..bb3388341 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index cce9df03b..4b109daf0 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "Secara otomatis akan terputus ketik tidak ada aktivitas."), ("Check for software update on startup", "Periksa pembaruan aplikasi saat sistem dinyalakan."), ("upgrade_rustdesk_server_pro_to_{}_tip", "Silahkan perbarui RustDesk Server Pro ke versi {} atau yang lebih baru!"), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index 51e5dd05c..e1d0be88c 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "Connessione non riuscita a causa di inattività"), ("Check for software update on startup", "All'avvio verifica presenza aggiornamenti programma"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Aggiorna RustDesk Server Pro alla versione {} o successiva!"), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 712f68053..04b00dbfe 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 6d2c4f43c..4d8677c81 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 2a6c3ef51..2eab96f76 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lt.rs b/src/lang/lt.rs index 468396992..c2dece955 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lv.rs b/src/lang/lv.rs index 26751f628..6163635a8 100644 --- a/src/lang/lv.rs +++ b/src/lang/lv.rs @@ -559,5 +559,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "Automātiski atvienots neaktivitātes dēļ"), ("Check for software update on startup", "Startējot pārbaudīt, vai nav programmatūras atjauninājumu"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Lūdzu, jauniniet RustDesk Server Pro uz versiju {} vai jaunāku!"), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index 33ffb7a8e..b879a896c 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index db2db9366..223692073 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "Automatycznie rozłącz przy bezczynności"), ("Check for software update on startup", "Sprawdź aktualizacje przy starcie programu"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Proszę zaktualizować RustDesk Server Pro do wersji {} lub nowszej!"), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index f0e26387e..f540bc76d 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index 7c76a6507..719886a18 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index 35c5358a8..b347278fc 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index a6547bc8f..0a647b3ce 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "Подключение не выполнено из-за неактивности"), ("Check for software update on startup", "Проверять обновления программы при запуске"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Обновите RustDesk Server Pro до версии {} или новее!"), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index c25dc377c..05c3160fd 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index 60d8e113b..c22b2ecd1 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index 56a13621e..d0875114d 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index f8d8c4edd..13819f37e 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index c09f02a25..e54b7c7b6 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index 962cda2d9..e442c826e 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index 2913ba116..2629540d2 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index 3f5c1c56e..20a1ce942 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index 0a8efc8bb..0074e8afb 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index 8fba30edb..facada5f1 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index 4d9fc6f18..9eec26b0c 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -556,5 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", ""), ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), + ("pull_group_failed_tip", ""), ].iter().cloned().collect(); } From 7229652e31d8807273e4b39a047df27143c3607d Mon Sep 17 00:00:00 2001 From: Kleofass Date: Sun, 24 Sep 2023 10:52:03 +0300 Subject: [PATCH 11/71] Update lv.rs --- src/lang/lv.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/lv.rs b/src/lang/lv.rs index 6163635a8..b1abd922b 100644 --- a/src/lang/lv.rs +++ b/src/lang/lv.rs @@ -559,6 +559,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "Automātiski atvienots neaktivitātes dēļ"), ("Check for software update on startup", "Startējot pārbaudīt, vai nav programmatūras atjauninājumu"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Lūdzu, jauniniet RustDesk Server Pro uz versiju {} vai jaunāku!"), - ("pull_group_failed_tip", ""), + ("pull_group_failed_tip", "Neizdevās atsvaidzināt grupu"), ].iter().cloned().collect(); } From fa1b61b3e338de4de59f6fed6408822600fb52e0 Mon Sep 17 00:00:00 2001 From: bovirus <1262554+bovirus@users.noreply.github.com> Date: Sun, 24 Sep 2023 10:54:29 +0200 Subject: [PATCH 12/71] Update Italian language --- src/lang/it.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/it.rs b/src/lang/it.rs index e1d0be88c..e0a944036 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -556,6 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "Connessione non riuscita a causa di inattività"), ("Check for software update on startup", "All'avvio verifica presenza aggiornamenti programma"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Aggiorna RustDesk Server Pro alla versione {} o successiva!"), - ("pull_group_failed_tip", ""), + ("pull_group_failed_tip", "Impossibile aggiornare il gruppo"), ].iter().cloned().collect(); } From 6b43042828625e1f0238b2be35638b6ab54ce401 Mon Sep 17 00:00:00 2001 From: 21pages Date: Sun, 24 Sep 2023 19:54:11 +0800 Subject: [PATCH 13/71] mobile still use no scrollable widgets Signed-off-by: 21pages --- flutter/lib/common/widgets/address_book.dart | 40 ++++++++------ flutter/lib/common/widgets/my_group.dart | 8 ++- flutter/lib/common/widgets/peers_view.dart | 58 ++++++++++++-------- 3 files changed, 63 insertions(+), 43 deletions(-) diff --git a/flutter/lib/common/widgets/address_book.dart b/flutter/lib/common/widgets/address_book.dart index 14a510cec..902df25c9 100644 --- a/flutter/lib/common/widgets/address_book.dart +++ b/flutter/lib/common/widgets/address_book.dart @@ -157,23 +157,29 @@ class _AddressBookState extends State { } else { tags = gFFI.abModel.tags; } - return DynamicGridView.builder( - gridDelegate: SliverGridDelegateWithWrapping( - mainAxisSpacing: 0, crossAxisSpacing: 0), - itemCount: tags.length, - itemBuilder: (BuildContext context, int index) { - final e = tags[index]; - return AddressBookTag( - name: e, - tags: gFFI.abModel.selectedTags, - onTap: () { - if (gFFI.abModel.selectedTags.contains(e)) { - gFFI.abModel.selectedTags.remove(e); - } else { - gFFI.abModel.selectedTags.add(e); - } - }); - }); + tagBuilder(String e) { + return AddressBookTag( + name: e, + tags: gFFI.abModel.selectedTags, + onTap: () { + if (gFFI.abModel.selectedTags.contains(e)) { + gFFI.abModel.selectedTags.remove(e); + } else { + gFFI.abModel.selectedTags.add(e); + } + }); + } + + return isDesktop + ? DynamicGridView.builder( + gridDelegate: SliverGridDelegateWithWrapping( + mainAxisSpacing: 0, crossAxisSpacing: 0), + itemCount: tags.length, + itemBuilder: (BuildContext context, int index) { + final e = tags[index]; + return tagBuilder(e); + }) + : Wrap(children: tags.map((e) => tagBuilder(e)).toList()); }); } diff --git a/flutter/lib/common/widgets/my_group.dart b/flutter/lib/common/widgets/my_group.dart index 07de0c86a..7f5db3bae 100644 --- a/flutter/lib/common/widgets/my_group.dart +++ b/flutter/lib/common/widgets/my_group.dart @@ -157,9 +157,11 @@ class _MyGroupState extends State { } return true; }).toList(); - return ListView.builder( - itemCount: items.length, - itemBuilder: (context, index) => _buildUserItem(items[index])); + return isDesktop + ? ListView.builder( + itemCount: items.length, + itemBuilder: (context, index) => _buildUserItem(items[index])) + : Column(children: items.map((e) => _buildUserItem(e)).toList()); }); } diff --git a/flutter/lib/common/widgets/peers_view.dart b/flutter/lib/common/widgets/peers_view.dart index 845b10cd3..c4df60479 100644 --- a/flutter/lib/common/widgets/peers_view.dart +++ b/flutter/lib/common/widgets/peers_view.dart @@ -178,29 +178,41 @@ class _PeersViewState extends State<_PeersView> with WindowListener { if (snapshot.hasData) { final peers = snapshot.data!; gFFI.peerTabModel.setCurrentTabCachedPeers(peers); - final child = DynamicGridView.builder( - gridDelegate: SliverGridDelegateWithWrapping( - mainAxisSpacing: space / 2, crossAxisSpacing: space), - itemCount: peers.length, - itemBuilder: (BuildContext context, int index) { - final visibilityChild = VisibilityDetector( - key: ValueKey(_cardId(peers[index].id)), - onVisibilityChanged: onVisibilityChanged, - child: widget.peerCardBuilder(peers[index]), - ); - return isDesktop - ? Obx( - () => SizedBox( - width: 220, - height: peerCardUiType.value == PeerUiType.grid - ? 140 - : 42, - child: visibilityChild, - ), - ) - : SizedBox(width: mobileWidth, child: visibilityChild); - }, - ); + buildOnePeer(Peer peer) { + final visibilityChild = VisibilityDetector( + key: ValueKey(_cardId(peer.id)), + onVisibilityChanged: onVisibilityChanged, + child: widget.peerCardBuilder(peer), + ); + return isDesktop + ? Obx( + () => SizedBox( + width: 220, + height: + peerCardUiType.value == PeerUiType.grid ? 140 : 42, + child: visibilityChild, + ), + ) + : SizedBox(width: mobileWidth, child: visibilityChild); + } + + final Widget child; + if (isDesktop) { + child = DynamicGridView.builder( + gridDelegate: SliverGridDelegateWithWrapping( + mainAxisSpacing: space / 2, crossAxisSpacing: space), + itemCount: peers.length, + itemBuilder: (BuildContext context, int index) { + return buildOnePeer(peers[index]); + }, + ); + } else { + child = Wrap( + spacing: space, + runSpacing: space, + children: peers.map((e) => buildOnePeer(e)).toList()); + } + if (updateEvent == UpdateEvent.load) { _curPeers.clear(); _curPeers.addAll(peers.map((e) => e.id)); From 9771c652c59766bb63c560270dc3a64739cedd9b Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 25 Sep 2023 00:15:36 +0800 Subject: [PATCH 14/71] fix, alt + tab, switch window, release alt state Signed-off-by: fufesou --- flutter/lib/desktop/pages/remote_page.dart | 6 ++-- src/keyboard.rs | 36 ++++++++-------------- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index 305782e7a..13271378d 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -209,7 +209,7 @@ class _RemotePageState extends State debugPrint("REMOTE PAGE dispose session $sessionId ${widget.id}"); await _renderTexture.destroy(closeSession); // ensure we leave this session, this is a double check - bind.sessionEnterOrLeave(sessionId: sessionId, enter: false); + _ffi.inputModel.enterOrLeave(false); DesktopMultiWindow.removeListener(this); _ffi.dialogManager.hideMobileActionsOverlay(); _ffi.recordingModel.onClose(); @@ -329,7 +329,7 @@ class _RemotePageState extends State if (!_rawKeyFocusNode.hasFocus) { _rawKeyFocusNode.requestFocus(); } - bind.sessionEnterOrLeave(sessionId: sessionId, enter: true); + _ffi.inputModel.enterOrLeave(true); } } @@ -349,7 +349,7 @@ class _RemotePageState extends State } // See [onWindowBlur]. if (!Platform.isWindows) { - bind.sessionEnterOrLeave(sessionId: sessionId, enter: false); + _ffi.inputModel.enterOrLeave(false); } } diff --git a/src/keyboard.rs b/src/keyboard.rs index d79e396bf..72b0ff2f8 100644 --- a/src/keyboard.rs +++ b/src/keyboard.rs @@ -14,10 +14,8 @@ use rdev::KeyCode; use rdev::{Event, EventType, Key}; #[cfg(any(target_os = "windows", target_os = "macos"))] use std::sync::atomic::{AtomicBool, Ordering}; -#[cfg(not(any(target_os = "android", target_os = "ios")))] -use std::time::SystemTime; use std::{ - collections::{HashMap, HashSet}, + collections::HashMap, sync::{Arc, Mutex}, }; @@ -35,7 +33,7 @@ const OS_LOWER_MACOS: &str = "macos"; static KEYBOARD_HOOKED: AtomicBool = AtomicBool::new(false); lazy_static::lazy_static! { - static ref TO_RELEASE: Arc>> = Arc::new(Mutex::new(HashSet::::new())); + static ref TO_RELEASE: Arc>> = Arc::new(Mutex::new(HashMap::new())); static ref MODIFIERS_STATE: Mutex> = { let mut m = HashMap::new(); m.insert(Key::ShiftLeft, false); @@ -336,12 +334,17 @@ pub fn release_remote_keys(keyboard_mode: &str) { // todo!: client quit suddenly, how to release keys? let to_release = TO_RELEASE.lock().unwrap().clone(); TO_RELEASE.lock().unwrap().clear(); - for key in to_release { - let event_type = EventType::KeyRelease(key); - let event = event_type_to_event(event_type); - // to-do: BUG - // Release events should be sent to the corresponding sessions, instead of current session. + for (key, mut event) in to_release.into_iter() { + event.event_type = EventType::KeyRelease(key); client::process_event(keyboard_mode, &event, None); + // If Alt or AltGr is pressed, we need to send another key stoke to release it. + // Because the controlled side may hold the alt state, if local window is switched by [Alt + Tab]. + if key == Key::Alt || key == Key::AltGr { + event.event_type = EventType::KeyPress(key); + client::process_event(keyboard_mode, &event, None); + event.event_type = EventType::KeyRelease(key); + client::process_event(keyboard_mode, &event, None); + } } } @@ -519,7 +522,7 @@ pub fn event_to_key_events( match event.event_type { EventType::KeyPress(key) => { - TO_RELEASE.lock().unwrap().insert(key); + TO_RELEASE.lock().unwrap().insert(key, event.clone()); } EventType::KeyRelease(key) => { TO_RELEASE.lock().unwrap().remove(&key); @@ -570,19 +573,6 @@ pub fn event_to_key_events( key_events } -#[cfg(not(any(target_os = "android", target_os = "ios")))] -pub fn event_type_to_event(event_type: EventType) -> Event { - Event { - event_type, - time: SystemTime::now(), - unicode: None, - platform_code: 0, - position_code: 0, - #[cfg(any(target_os = "windows", target_os = "macos"))] - extra_data: 0, - } -} - pub fn send_key_event(key_event: &KeyEvent) { #[cfg(not(any(feature = "flutter", feature = "cli")))] if let Some(session) = CUR_SESSION.lock().unwrap().as_ref() { From d8001fcaea003207ef25649e14f784957e92ac5b Mon Sep 17 00:00:00 2001 From: Mr-Update <37781396+Mr-Update@users.noreply.github.com> Date: Sun, 24 Sep 2023 21:06:40 +0200 Subject: [PATCH 15/71] Update de.rs --- src/lang/de.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/de.rs b/src/lang/de.rs index 893882a8e..4d2d8b466 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -556,6 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "Automatische Trennung der Verbindung aufgrund von Inaktivität"), ("Check for software update on startup", "Beim Start auf Softwareaktualisierung prüfen"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Bitte aktualisieren Sie RustDesk Server Pro auf die Version {} oder neuer!"), - ("pull_group_failed_tip", ""), + ("pull_group_failed_tip", "Aktualisierung der Gruppe fehlgeschlagen"), ].iter().cloned().collect(); } From fd4cd3ed04fd921e0a5c93ee543a36d9d4317ed3 Mon Sep 17 00:00:00 2001 From: Ibnul Mutaki Date: Mon, 25 Sep 2023 08:38:58 +0700 Subject: [PATCH 16/71] update id --- src/lang/id.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/id.rs b/src/lang/id.rs index 4b109daf0..967ff2bcd 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -556,6 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "Secara otomatis akan terputus ketik tidak ada aktivitas."), ("Check for software update on startup", "Periksa pembaruan aplikasi saat sistem dinyalakan."), ("upgrade_rustdesk_server_pro_to_{}_tip", "Silahkan perbarui RustDesk Server Pro ke versi {} atau yang lebih baru!"), - ("pull_group_failed_tip", ""), + ("pull_group_failed_tip", "Gagal memperbarui grup"), ].iter().cloned().collect(); } From a437524c8f2ee160a985f338024e82978595f74f Mon Sep 17 00:00:00 2001 From: 21pages Date: Sun, 24 Sep 2023 17:56:35 +0800 Subject: [PATCH 17/71] await loadCache Signed-off-by: 21pages --- flutter/lib/main.dart | 6 ++---- flutter/lib/models/ab_model.dart | 2 +- flutter/lib/models/group_model.dart | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/flutter/lib/main.dart b/flutter/lib/main.dart index d4e81a82d..79ef0616d 100644 --- a/flutter/lib/main.dart +++ b/flutter/lib/main.dart @@ -125,8 +125,7 @@ void runMainApp(bool startService) async { bind.pluginSyncUi(syncTo: kAppTypeMain); bind.pluginListReload(); } - gFFI.abModel.loadCache(); - gFFI.groupModel.loadCache(); + await Future.wait([gFFI.abModel.loadCache(), gFFI.groupModel.loadCache()]); gFFI.userModel.refreshCurrentUser(); runApp(App()); // Set window option. @@ -154,8 +153,7 @@ void runMobileApp() async { await initEnv(kAppTypeMain); if (isAndroid) androidChannelInit(); platformFFI.syncAndroidServiceAppDirConfigPath(); - gFFI.abModel.loadCache(); - gFFI.groupModel.loadCache(); + await Future.wait([gFFI.abModel.loadCache(), gFFI.groupModel.loadCache()]); gFFI.userModel.refreshCurrentUser(); runApp(App()); } diff --git a/flutter/lib/models/ab_model.dart b/flutter/lib/models/ab_model.dart index e64759f91..03fb5897f 100644 --- a/flutter/lib/models/ab_model.dart +++ b/flutter/lib/models/ab_model.dart @@ -478,7 +478,7 @@ class AbModel { } } - loadCache() async { + Future loadCache() async { try { if (_cacheLoadOnceFlag || abLoading.value || initialized) return; _cacheLoadOnceFlag = true; diff --git a/flutter/lib/models/group_model.dart b/flutter/lib/models/group_model.dart index ddb02d370..ebd49b560 100644 --- a/flutter/lib/models/group_model.dart +++ b/flutter/lib/models/group_model.dart @@ -231,7 +231,7 @@ class GroupModel { } } - loadCache() async { + Future loadCache() async { try { if (_cacheLoadOnceFlag || groupLoading.value || initialized) return; _cacheLoadOnceFlag = true; From 5236dcfe5207e86f1a10d8371e41878fd36ac2d0 Mon Sep 17 00:00:00 2001 From: 21pages Date: Mon, 25 Sep 2023 11:19:30 +0800 Subject: [PATCH 18/71] peers view show no more than 1000 after filter Signed-off-by: 21pages --- flutter/lib/common/widgets/peers_view.dart | 3 ++- flutter/lib/models/group_model.dart | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/flutter/lib/common/widgets/peers_view.dart b/flutter/lib/common/widgets/peers_view.dart index c4df60479..0b3785199 100644 --- a/flutter/lib/common/widgets/peers_view.dart +++ b/flutter/lib/common/widgets/peers_view.dart @@ -176,7 +176,8 @@ class _PeersViewState extends State<_PeersView> with WindowListener { return FutureBuilder>( builder: (context, snapshot) { if (snapshot.hasData) { - final peers = snapshot.data!; + var peers = snapshot.data!; + if (peers.length > 1000) peers = peers.sublist(0, 1000); gFFI.peerTabModel.setCurrentTabCachedPeers(peers); buildOnePeer(Peer peer) { final visibilityChild = VisibilityDetector( diff --git a/flutter/lib/models/group_model.dart b/flutter/lib/models/group_model.dart index ebd49b560..b8bc2722d 100644 --- a/flutter/lib/models/group_model.dart +++ b/flutter/lib/models/group_model.dart @@ -173,9 +173,6 @@ class GroupModel { } if (json.containsKey('total')) { if (total == 0) total = json['total']; - if (total > 1000) { - total = 1000; - } if (json.containsKey('data')) { final data = json['data']; if (data is List) { @@ -188,9 +185,6 @@ class GroupModel { } else { tmpPeers[index] = peer; } - if (tmpPeers.length >= 1000) { - break; - } } } } From 167bf70cd65c0902a8239554685b69ebfea0facf Mon Sep 17 00:00:00 2001 From: 21pages Date: Mon, 25 Sep 2023 13:35:01 +0800 Subject: [PATCH 19/71] mobile: limited height scroll tags/users, and scrollable peers Signed-off-by: 21pages --- flutter/lib/common/widgets/address_book.dart | 22 +++++++++------- flutter/lib/common/widgets/my_group.dart | 13 +++++++--- flutter/lib/common/widgets/peers_view.dart | 25 ++++++------------- flutter/lib/mobile/pages/connection_page.dart | 2 +- flutter/pubspec.lock | 8 +++--- flutter/pubspec.yaml | 4 +-- 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/flutter/lib/common/widgets/address_book.dart b/flutter/lib/common/widgets/address_book.dart index 902df25c9..5cc06c7a1 100644 --- a/flutter/lib/common/widgets/address_book.dart +++ b/flutter/lib/common/widgets/address_book.dart @@ -1,3 +1,5 @@ +import 'dart:math'; + import 'package:dynamic_layouts/dynamic_layouts.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hbb/common/formatter/id_formatter.dart'; @@ -170,16 +172,18 @@ class _AddressBookState extends State { }); } + final gridView = DynamicGridView.builder( + shrinkWrap: isMobile, + gridDelegate: SliverGridDelegateWithWrapping(), + itemCount: tags.length, + itemBuilder: (BuildContext context, int index) { + final e = tags[index]; + return tagBuilder(e); + }); + final maxHeight = max(MediaQuery.of(context).size.height / 6, 100.0); return isDesktop - ? DynamicGridView.builder( - gridDelegate: SliverGridDelegateWithWrapping( - mainAxisSpacing: 0, crossAxisSpacing: 0), - itemCount: tags.length, - itemBuilder: (BuildContext context, int index) { - final e = tags[index]; - return tagBuilder(e); - }) - : Wrap(children: tags.map((e) => tagBuilder(e)).toList()); + ? gridView + : LimitedBox(maxHeight: maxHeight, child: gridView); }); } diff --git a/flutter/lib/common/widgets/my_group.dart b/flutter/lib/common/widgets/my_group.dart index 7f5db3bae..8cd997be3 100644 --- a/flutter/lib/common/widgets/my_group.dart +++ b/flutter/lib/common/widgets/my_group.dart @@ -1,3 +1,5 @@ +import 'dart:math'; + import 'package:flutter/material.dart'; import 'package:flutter_hbb/common/hbbs/hbbs.dart'; import 'package:flutter_hbb/common/widgets/login.dart'; @@ -157,11 +159,14 @@ class _MyGroupState extends State { } return true; }).toList(); + final listView = ListView.builder( + shrinkWrap: isMobile, + itemCount: items.length, + itemBuilder: (context, index) => _buildUserItem(items[index])); + var maxHeight = max(MediaQuery.of(context).size.height / 6, 100.0); return isDesktop - ? ListView.builder( - itemCount: items.length, - itemBuilder: (context, index) => _buildUserItem(items[index])) - : Column(children: items.map((e) => _buildUserItem(e)).toList()); + ? listView + : LimitedBox(maxHeight: maxHeight, child: listView); }); } diff --git a/flutter/lib/common/widgets/peers_view.dart b/flutter/lib/common/widgets/peers_view.dart index 0b3785199..1138663ff 100644 --- a/flutter/lib/common/widgets/peers_view.dart +++ b/flutter/lib/common/widgets/peers_view.dart @@ -197,23 +197,14 @@ class _PeersViewState extends State<_PeersView> with WindowListener { : SizedBox(width: mobileWidth, child: visibilityChild); } - final Widget child; - if (isDesktop) { - child = DynamicGridView.builder( - gridDelegate: SliverGridDelegateWithWrapping( - mainAxisSpacing: space / 2, crossAxisSpacing: space), - itemCount: peers.length, - itemBuilder: (BuildContext context, int index) { - return buildOnePeer(peers[index]); - }, - ); - } else { - child = Wrap( - spacing: space, - runSpacing: space, - children: peers.map((e) => buildOnePeer(e)).toList()); - } - + final child = DynamicGridView.builder( + gridDelegate: SliverGridDelegateWithWrapping( + mainAxisSpacing: space / 2, crossAxisSpacing: space), + itemCount: peers.length, + itemBuilder: (BuildContext context, int index) { + return buildOnePeer(peers[index]); + }, + ); if (updateEvent == UpdateEvent.load) { _curPeers.clear(); _curPeers.addAll(peers.map((e) => e.id)); diff --git a/flutter/lib/mobile/pages/connection_page.dart b/flutter/lib/mobile/pages/connection_page.dart index 4a14f8466..5a61a2fc8 100644 --- a/flutter/lib/mobile/pages/connection_page.dart +++ b/flutter/lib/mobile/pages/connection_page.dart @@ -80,7 +80,7 @@ class _ConnectionPageState extends State { _buildRemoteIDTextField(), ])), SliverFillRemaining( - hasScrollBody: false, + hasScrollBody: true, child: PeerTabPage(), ) ], diff --git a/flutter/pubspec.lock b/flutter/pubspec.lock index aa0ead349..37481b86e 100644 --- a/flutter/pubspec.lock +++ b/flutter/pubspec.lock @@ -400,11 +400,11 @@ packages: dependency: "direct main" description: path: "packages/dynamic_layouts" - ref: "0023d01996576e494094793a6552463f01c5627a" - resolved-ref: "0023d01996576e494094793a6552463f01c5627a" - url: "https://github.com/flutter/packages.git" + ref: "74cc4b495dcf3a4cb8df38d9ecc89f53f074a2c6" + resolved-ref: "74cc4b495dcf3a4cb8df38d9ecc89f53f074a2c6" + url: "https://github.com/21pages/packages.git" source: git - version: "0.0.1+1" + version: "0.0.1+2" event_bus: dependency: transitive description: diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index 9c06d0bbf..3969c288a 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -102,9 +102,9 @@ dependencies: flex_color_picker: ^3.3.0 dynamic_layouts: git: - url: https://github.com/flutter/packages.git + url: https://github.com/21pages/packages.git path: packages/dynamic_layouts - ref: 0023d01996576e494094793a6552463f01c5627a + ref: 74cc4b495dcf3a4cb8df38d9ecc89f53f074a2c6 dev_dependencies: icons_launcher: ^2.0.4 From 13da75c2b644cf113ccb1fd10c3f6d423d9030ec Mon Sep 17 00:00:00 2001 From: Sahil Yeole Date: Mon, 25 Sep 2023 16:53:34 +0530 Subject: [PATCH 20/71] fix wayland server starting late Signed-off-by: Sahil Yeole --- src/platform/linux.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/linux.rs b/src/platform/linux.rs index f78f1f87c..de8c9d732 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -1088,7 +1088,7 @@ mod desktop { self.uid = seat0_values[1].clone(); self.username = seat0_values[2].clone(); self.protocal = get_display_server_of_session(&self.sid).into(); - if self.is_login_wayland() { + if self.is_wayland() { self.display = "".to_owned(); self.xauth = "".to_owned(); self.is_rustdesk_subprocess = false; From 23680ccb143961adb576dc88aec09749cb3ddfab Mon Sep 17 00:00:00 2001 From: 21pages Date: Mon, 25 Sep 2023 21:04:40 +0800 Subject: [PATCH 21/71] replace desktop outer scroll view with Column, so that there will be only one scrollbar Signed-off-by: 21pages --- flutter/lib/common/widgets/peer_tab_page.dart | 2 +- .../lib/desktop/pages/connection_page.dart | 37 ++++++------------- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/flutter/lib/common/widgets/peer_tab_page.dart b/flutter/lib/common/widgets/peer_tab_page.dart index dccf83c7b..8f02a5c77 100644 --- a/flutter/lib/common/widgets/peer_tab_page.dart +++ b/flutter/lib/common/widgets/peer_tab_page.dart @@ -146,7 +146,7 @@ class _PeerTabPageState extends State ], )), ), - ), + ).paddingOnly(right: isDesktop ? 12 : 0), _createPeersView(), ], ); diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart index 5990d11bb..9cfa1defc 100644 --- a/flutter/lib/desktop/pages/connection_page.dart +++ b/flutter/lib/desktop/pages/connection_page.dart @@ -33,9 +33,6 @@ class _ConnectionPageState extends State /// Controller for the id input bar. final _idController = IDTextEditingController(); - /// Nested scroll controller - final _scrollController = ScrollController(); - Timer? _updateTimer; final RxBool _idInputFocused = false.obs; @@ -121,30 +118,18 @@ class _ConnectionPageState extends State return Column( children: [ Expanded( - child: DesktopScrollWrapper( - scrollController: _scrollController, - child: CustomScrollView( - controller: _scrollController, - physics: DraggableNeverScrollableScrollPhysics(), - slivers: [ - SliverList( - delegate: SliverChildListDelegate([ - Row( - children: [ - Flexible(child: _buildRemoteIDTextField(context)), - ], - ).marginOnly(top: 22), - SizedBox(height: 12), - Divider().paddingOnly(right: 12), - ])), - SliverFillRemaining( - hasScrollBody: true, - child: PeerTabPage().paddingOnly(right: 12.0), - ) + child: Column( + children: [ + Row( + children: [ + Flexible(child: _buildRemoteIDTextField(context)), ], - ).paddingOnly(left: 12.0), - ), - ), + ).marginOnly(top: 22), + SizedBox(height: 12), + Divider().paddingOnly(right: 12), + Expanded(child: PeerTabPage()), + ], + ).paddingOnly(left: 12.0)), const Divider(height: 1), buildStatus() ], From f29363f56d975b5ef26b2811a1c131508f3863b7 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Mon, 25 Sep 2023 21:31:33 +0800 Subject: [PATCH 22/71] debug=true for debug --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 9e8224fc1..1300920a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -170,3 +170,4 @@ panic = 'abort' strip = true #opt-level = 'z' # only have smaller size after strip rpath = true +debug = true From daa41f86646ff97ffca6a47367ce286040d8a62f Mon Sep 17 00:00:00 2001 From: Andrzej Rudnik Date: Mon, 25 Sep 2023 16:29:19 +0200 Subject: [PATCH 23/71] Update pl.rs --- src/lang/pl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 223692073..71813688c 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -556,6 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "Automatycznie rozłącz przy bezczynności"), ("Check for software update on startup", "Sprawdź aktualizacje przy starcie programu"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Proszę zaktualizować RustDesk Server Pro do wersji {} lub nowszej!"), - ("pull_group_failed_tip", ""), + ("pull_group_failed_tip", "Błąd odświeżania grup"), ].iter().cloned().collect(); } From 4dc2172426a5a103b07b49ac1e04bcc7e2c688ed Mon Sep 17 00:00:00 2001 From: flusheDData <116861809+flusheDData@users.noreply.github.com> Date: Mon, 25 Sep 2023 16:31:05 +0200 Subject: [PATCH 24/71] Update es.rs New term added --- src/lang/es.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/es.rs b/src/lang/es.rs index f3887cd8e..4de8a142e 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -556,6 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "Desconectar automáticamente por inactividad."), ("Check for software update on startup", "Comprobar actualización al iniciar"), ("upgrade_rustdesk_server_pro_to_{}_tip", "¡Por favor, actualiza RustDesk Server Pro a la versión {} o superior"), - ("pull_group_failed_tip", ""), + ("pull_group_failed_tip", "No se ha podido refrescar el grupo"), ].iter().cloned().collect(); } From ed90979417c81b25ba6b4095ee1427e2b94b0aa6 Mon Sep 17 00:00:00 2001 From: solokot Date: Mon, 25 Sep 2023 17:47:41 +0300 Subject: [PATCH 25/71] Update ru.rs --- src/lang/ru.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lang/ru.rs b/src/lang/ru.rs index 0a647b3ce..3556bdbd0 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -556,6 +556,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection failed due to inactivity", "Подключение не выполнено из-за неактивности"), ("Check for software update on startup", "Проверять обновления программы при запуске"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Обновите RustDesk Server Pro до версии {} или новее!"), - ("pull_group_failed_tip", ""), + ("pull_group_failed_tip", "Невозможно обновить группу"), ].iter().cloned().collect(); } From 994ba1edd9a18761435ab557653f734c80675049 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Mon, 25 Sep 2023 22:54:00 +0800 Subject: [PATCH 26/71] debug=true does not work, update pub --- Cargo.toml | 1 - flutter/pubspec.lock | 469 ++++++++++++++++++++++++------------------- 2 files changed, 262 insertions(+), 208 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1300920a7..9e8224fc1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -170,4 +170,3 @@ panic = 'abort' strip = true #opt-level = 'z' # only have smaller size after strip rpath = true -debug = true diff --git a/flutter/pubspec.lock b/flutter/pubspec.lock index 37481b86e..df4a653e3 100644 --- a/flutter/pubspec.lock +++ b/flutter/pubspec.lock @@ -29,34 +29,34 @@ packages: dependency: transitive description: name: animations - sha256: fe8a6bdca435f718bb1dc8a11661b2c22504c6da40ef934cee8327ed77934164 + sha256: ef57563eed3620bd5d75ad96189846aca1e033c0c45fc9a7d26e80ab02b88a70 url: "https://pub.dev" source: hosted - version: "2.0.7" + version: "2.0.8" archive: dependency: transitive description: name: archive - sha256: d6347d54a2d8028e0437e3c099f66fdb8ae02c4720c1e7534c9f24c10351f85d + sha256: "20071638cbe4e5964a427cfa0e86dce55d060bc7d82d56f3554095d7239a8765" url: "https://pub.dev" source: hosted - version: "3.3.6" + version: "3.4.2" args: dependency: transitive description: name: args - sha256: c372bb384f273f0c2a8aaaa226dad84dc27c8519a691b888725dec59518ad53a + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" async: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" auto_size_text: dependency: "direct main" description: @@ -69,10 +69,10 @@ packages: dependency: "direct main" description: name: auto_size_text_field - sha256: "8967129167193fefbb7a8707ade1bb71f9e52b9a5cf6da0132b7f6b7946c5a3f" + sha256: d47c81ffa9b61d219f6c50492dc03ea28fa9346561b2ec33b46ccdc000ddb0aa url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.2" back_button_interceptor: dependency: "direct main" description: @@ -81,14 +81,22 @@ packages: url: "https://pub.dev" source: hosted version: "6.0.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" bot_toast: dependency: "direct main" description: name: bot_toast - sha256: "19306147033316a7873c5d261b874fca3f341c05e4e1c12be56153ad11187edd" + sha256: "6b93030a99a98335b8827ecd83021e92e885ffc61d261d3825ffdecdd17f3bdf" url: "https://pub.dev" source: hosted - version: "4.0.3" + version: "4.1.3" build: dependency: transitive description: @@ -125,10 +133,10 @@ packages: dependency: transitive description: name: build_resolvers - sha256: "6c4dd11d05d056e76320b828a1db0fc01ccd376922526f8e9d6c796a5adbac20" + sha256: d912852cce27c9e80a93603db721c267716894462e7033165178b91138587972 url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.3.2" build_runner: dependency: "direct dev" description: @@ -141,10 +149,10 @@ packages: dependency: transitive description: name: build_runner_core - sha256: "14febe0f5bac5ae474117a36099b4de6f1dbc52df6c5e55534b3da9591bf4292" + sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41" url: "https://pub.dev" source: hosted - version: "7.2.7" + version: "7.2.10" built_collection: dependency: transitive description: @@ -157,34 +165,34 @@ packages: dependency: transitive description: name: built_value - sha256: "169565c8ad06adb760c3645bf71f00bff161b00002cace266cad42c5d22a7725" + sha256: a8de5955205b4d1dbbbc267daddf2178bd737e4bab8987c04a500478c9651e74 url: "https://pub.dev" source: hosted - version: "8.4.3" + version: "8.6.3" cached_network_image: dependency: transitive description: name: cached_network_image - sha256: fd3d0dc1d451f9a252b32d95d3f0c3c487bc41a75eba2e6097cb0b9c71491b15 + sha256: f98972704692ba679db144261172a8e20feb145636c617af0eb4022132a6797f url: "https://pub.dev" source: hosted - version: "3.2.3" + version: "3.3.0" cached_network_image_platform_interface: dependency: transitive description: name: cached_network_image_platform_interface - sha256: bb2b8403b4ccdc60ef5f25c70dead1f3d32d24b9d6117cfc087f496b178594a7 + sha256: "56aa42a7a01e3c9db8456d9f3f999931f1e05535b5a424271e9a38cabf066613" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "3.0.0" cached_network_image_web: dependency: transitive description: name: cached_network_image_web - sha256: b8eb814ebfcb4dea049680f8c1ffb2df399e4d03bf7a352c775e26fa06e02fa0 + sha256: "759b9a9f8f6ccbb66c185df805fac107f05730b1dab9c64626d1008cca532257" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.1.0" characters: dependency: transitive description: @@ -205,10 +213,10 @@ packages: dependency: transitive description: name: checked_yaml - sha256: "3d1505d91afa809d177efd4eed5bb0eb65805097a1463abdd2add076effae311" + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.3" cli_util: dependency: transitive description: @@ -229,10 +237,10 @@ packages: dependency: transitive description: name: code_builder - sha256: "0d43dd1288fd145de1ecc9a3948ad4a6d5a82f0a14c4fdd0892260787d975cbe" + sha256: "1be9be30396d7e4c0db42c35ea6ccd7cc6a1e19916b5dc64d6ac216b5544d677" url: "https://pub.dev" source: hosted - version: "4.4.0" + version: "4.7.0" collection: dependency: transitive description: @@ -269,34 +277,34 @@ packages: dependency: transitive description: name: cross_file - sha256: f71079978789bc2fe78d79227f1f8cfe195b31bbd8db2399b0d15a4b96fb843b + sha256: fd832b5384d0d6da4f6df60b854d33accaaeb63aa9e10e736a87381f08dee2cb url: "https://pub.dev" source: hosted - version: "0.3.3+2" + version: "0.3.3+5" crypto: dependency: transitive description: name: crypto - sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" csslib: dependency: transitive description: name: csslib - sha256: b36c7f7e24c0bdf1bf9a3da461c837d1de64b9f8beb190c9011d8c72a3dfd745 + sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" url: "https://pub.dev" source: hosted - version: "0.17.2" + version: "1.0.0" dart_style: dependency: transitive description: name: dart_style - sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + sha256: abd7625e16f51f554ea244d090292945ec4d4be7bfbaf2ec8cccea568919d334 url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.3" dash_chat_2: dependency: "direct main" description: @@ -328,7 +336,7 @@ packages: description: path: "." ref: HEAD - resolved-ref: e51fddf7f3b46d4423b7aa79ba824a45a1ea1b7a + resolved-ref: ba5de698dbe51a961d16ede8a94331d594873e62 url: "https://github.com/rustdesk-org/rustdesk_desktop_multi_window" source: git version: "0.1.0" @@ -392,10 +400,10 @@ packages: dependency: "direct main" description: name: dropdown_button2 - sha256: "4458d81bfd24207f3d58f66f78097064e02f810f94cf1bc80bf20fe7685ebc80" + sha256: b0fe8d49a030315e9eef6c7ac84ca964250155a6224d491c1365061bc974a9e1 url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.3.9" dynamic_layouts: dependency: "direct main" description: @@ -425,10 +433,10 @@ packages: dependency: "direct main" description: name: ffi - sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.0" ffigen: dependency: "direct dev" description: @@ -449,18 +457,50 @@ packages: dependency: "direct main" description: name: file_picker - sha256: d090ae03df98b0247b82e5928f44d1b959867049d18d73635e2e0bc3f49542b9 + sha256: b85eb92b175767fdaa0c543bf3b0d1f610fe966412ea72845fe5ba7801e763ff url: "https://pub.dev" source: hosted - version: "5.2.5" + version: "5.2.10" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492" + url: "https://pub.dev" + source: hosted + version: "0.9.2+1" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: b15c3da8bd4908b9918111fa486903f5808e388b8d1c559949f584725a6594d6 + url: "https://pub.dev" + source: hosted + version: "0.9.3+3" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: "0aa47a725c346825a2bd396343ce63ac00bda6eff2fbc43eabe99737dede8262" + url: "https://pub.dev" + source: hosted + version: "2.6.1" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: d3547240c20cabf205c7c7f01a50ecdbc413755814d6677f3cb366f04abcead0 + url: "https://pub.dev" + source: hosted + version: "0.9.3+1" fixnum: dependency: transitive description: name: fixnum - sha256: "04be3e934c52e082558cc9ee21f42f5c1cd7a1262f4c63cd0357c08d5bba81ec" + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.1.0" flex_color_picker: dependency: "direct main" description: @@ -482,14 +522,6 @@ packages: description: flutter source: sdk version: "0.0.0" - flutter_blurhash: - dependency: transitive - description: - name: flutter_blurhash - sha256: "05001537bd3fac7644fa6558b09ec8c0a3f2eba78c0765f88912882b1331a5c6" - url: "https://pub.dev" - source: hosted - version: "0.7.0" flutter_breadcrumb: dependency: "direct main" description: @@ -502,10 +534,10 @@ packages: dependency: transitive description: name: flutter_cache_manager - sha256: "32cd900555219333326a2d0653aaaf8671264c29befa65bbd9856d204a4c9fb3" + sha256: "8207f27539deb83732fdda03e259349046a39a4c767269285f449ade355d54ba" url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "3.3.1" flutter_custom_cursor: dependency: "direct main" description: @@ -527,10 +559,10 @@ packages: dependency: "direct main" description: name: flutter_keyboard_visibility - sha256: "86b71bbaffa38e885f5c21b1182408b9be6951fd125432cf6652c636254cef2d" + sha256: "4983655c26ab5b959252ee204c2fffa4afeb4413cd030455194ec0caa3b8e7cb" url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "5.4.1" flutter_keyboard_visibility_linux: dependency: transitive description: @@ -583,10 +615,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.3" flutter_localizations: dependency: "direct main" description: flutter @@ -604,10 +636,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "60fc7b78455b94e6de2333d2f95196d32cf5c22f4b0b0520a628804cb463503b" + sha256: f185ac890306b5779ecbd611f52502d8d4d63d27703ef73161ca0407e815f02c url: "https://pub.dev" source: hosted - version: "2.0.7" + version: "2.0.16" flutter_rust_bridge: dependency: "direct main" description: @@ -620,10 +652,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: f991fdb1533c3caeee0cdc14b04f50f0c3916f0dbcbc05237ccbe4e3c6b93f3f + sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.0.7" flutter_web_plugins: dependency: transitive description: flutter @@ -665,34 +697,34 @@ packages: dependency: transitive description: name: glob - sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c" + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" graphs: dependency: transitive description: name: graphs - sha256: f9e130f3259f52d26f0cfc0e964513796dafed572fa52e45d2f8d6ca14db39b2 + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.3.1" html: dependency: transitive description: name: html - sha256: d9793e10dbe0e6c364f4c59bf3e01fb33a9b2a674bc7a1081693dba0614b6269 + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" url: "https://pub.dev" source: hosted - version: "0.15.1" + version: "0.15.4" http: dependency: "direct main" description: name: http - sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" url: "https://pub.dev" source: hosted - version: "0.13.5" + version: "0.13.6" http_multi_server: dependency: transitive description: @@ -713,58 +745,82 @@ packages: dependency: "direct dev" description: name: icons_launcher - sha256: f8ccfb80b56856b6eac586980bdd9c14f5ec24fb87127514055445ceb9424f4c + sha256: af05397792f6d82b93375a8a0253b8db0d3f816ef1dd1bf5c35cbab55321d327 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.3" image: dependency: "direct main" description: name: image - sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf + sha256: "93d1141eb65fe62414d5492de96ca2bff97eba0ca9218a89ad407a6f201fcadf" url: "https://pub.dev" source: hosted - version: "4.0.17" + version: "4.1.2" image_picker: dependency: "direct main" description: name: image_picker - sha256: f98d76672d309c8b7030c323b3394669e122d52b307d2bbd8d06bd70f5b2aabe + sha256: b6951e25b795d053a6ba03af5f710069c99349de9341af95155d52665cb4607c url: "https://pub.dev" source: hosted - version: "0.8.6+1" + version: "0.8.9" image_picker_android: dependency: transitive description: name: image_picker_android - sha256: b1cbfec0f5aef427a18eb573f5445af8c9c568626bf3388553e40c263d3f7368 + sha256: "0c7b83bbe2980c8a8e36e974f055e11e51675784e13a4762889feed0f3937ff2" url: "https://pub.dev" source: hosted - version: "0.8.5+5" + version: "0.8.8+1" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - sha256: "7d319fb74955ca46d9bf7011497860e3923bb67feebcf068f489311065863899" + sha256: "869fe8a64771b7afbc99fc433a5f7be2fea4d1cb3d7c11a48b6b579eb9c797f0" url: "https://pub.dev" source: hosted - version: "2.1.10" + version: "2.2.0" image_picker_ios: dependency: transitive description: name: image_picker_ios - sha256: "39c013200046d14c58b71dc4fa3d00e425fc9c699d589136cd3ca018727c0493" + sha256: c5538cacefacac733c724be7484377923b476216ad1ead35a0d2eadcdc0fc497 url: "https://pub.dev" source: hosted - version: "0.8.6+6" + version: "0.8.8+2" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "4ed1d9bb36f7cd60aa6e6cd479779cc56a4cb4e4de8f49d487b1aaad831300fa" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "3f5ad1e8112a9a6111c46d0b57a7be2286a9a07fc6e1976fdf5be2bd31d4ff62" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - sha256: "7cef2f28f4f2fef99180f636c3d446b4ccbafd6ba0fad2adc9a80c4040f656b8" + sha256: ed9b00e63977c93b0d2d2b343685bed9c324534ba5abafbb3dfbd6a780b1b514 url: "https://pub.dev" source: hosted - version: "2.6.2" + version: "2.9.1" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" intl: dependency: transitive description: @@ -793,34 +849,34 @@ packages: dependency: transitive description: name: json_annotation - sha256: c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317 + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "4.8.1" lints: dependency: transitive description: name: lints - sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.1" logging: dependency: transitive description: name: logging - sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" matcher: dependency: transitive description: name: matcher - sha256: c94db23593b89766cda57aab9ac311e3616cf87c6fa4e9749df032f66f30dcb8 + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.14" + version: "0.12.16" material_color_utilities: dependency: transitive description: @@ -857,10 +913,10 @@ packages: dependency: transitive description: name: octo_image - sha256: "107f3ed1330006a3bea63615e81cf637433f5135a52466c7caa0e7152bca9143" + sha256: "45b40f99622f11901238e18d48f5f12ea36426d8eced9f4cbf58479c7aa2430d" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "2.0.0" package_config: dependency: transitive description: @@ -913,50 +969,50 @@ packages: dependency: "direct main" description: name: path_provider - sha256: dcea5feb97d8abf90cab9e9030b497fb7c3cbf26b7a1fe9e3ef7dcb0a1ddec95 + sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa url: "https://pub.dev" source: hosted - version: "2.0.12" + version: "2.1.1" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: a776c088d671b27f6e3aa8881d64b87b3e80201c64e8869b811325de7a76c15e + sha256: "6b8b19bd80da4f11ce91b2d1fb931f3006911477cec227cce23d3253d80df3f1" url: "https://pub.dev" source: hosted - version: "2.0.22" + version: "2.2.0" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "62a68e7e1c6c459f9289859e2fae58290c981ce21d1697faf54910fe1faa4c74" + sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.3.1" path_provider_linux: dependency: transitive description: name: path_provider_linux - sha256: ab0987bf95bc591da42dffb38c77398fc43309f0b9b894dcc5d6f40c4b26c379 + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 url: "https://pub.dev" source: hosted - version: "2.1.7" + version: "2.2.1" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: f0abc8ebd7253741f05488b4813d936b4d07c6bae3e86148a09e342ee4b08e76 + sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.1.1" path_provider_windows: dependency: transitive description: name: path_provider_windows - sha256: bcabbe399d4042b8ee687e17548d5d3f527255253b4a639f5f8d2094a9c2b45c + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.2.1" pedantic: dependency: transitive description: @@ -969,42 +1025,42 @@ packages: dependency: "direct main" description: name: percent_indicator - sha256: cec41f67181fbd5322aa68b355621d1a4eea827426b8eeb613f6cbe195ff7b4a + sha256: c37099ad833a883c9d71782321cb65c3a848c21b6939b6185f0ff6640d05814c url: "https://pub.dev" source: hosted - version: "4.2.2" + version: "4.2.3" petitparser: dependency: transitive description: name: petitparser - sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 url: "https://pub.dev" source: hosted - version: "5.1.0" + version: "5.4.0" platform: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.2" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a + sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.6" pointycastle: dependency: transitive description: name: pointycastle - sha256: db7306cf0249f838d1a24af52b5a5887c5bf7f31d8bb4e827d071dc0939ad346 + sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" url: "https://pub.dev" source: hosted - version: "3.6.2" + version: "3.7.3" pool: dependency: transitive description: @@ -1013,14 +1069,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.1" - process: - dependency: transitive - description: - name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" - url: "https://pub.dev" - source: hosted - version: "4.2.4" provider: dependency: "direct main" description: @@ -1033,26 +1081,26 @@ packages: dependency: transitive description: name: pub_semver - sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" pubspec_parse: dependency: transitive description: name: pubspec_parse - sha256: "75f6614d6dde2dc68948dffbaa4fe5dae32cd700eb9fb763fe11dfb45a3c4d0a" + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.3" puppeteer: dependency: transitive description: name: puppeteer - sha256: "4e235aaf9a338a45c9eb1ee38956e0ba369867bf144d7a27fdaf245409b2b87b" + sha256: dd49117259867d0ce0de33ddd95628fb70cff94581a6432c08272447b8dd1d27 url: "https://pub.dev" source: hosted - version: "2.21.0" + version: "2.24.0" qr_code_scanner: dependency: "direct main" description: @@ -1080,12 +1128,11 @@ packages: screen_retriever: dependency: transitive description: - path: "." - ref: "406b9b0" - resolved-ref: "406b9b038b2c1d779f1e7bf609c8c248be247372" - url: "https://github.com/Kingtous/rustdesk_screen_retriever.git" - source: git - version: "0.1.2" + name: screen_retriever + sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90" + url: "https://pub.dev" + source: hosted + version: "0.1.9" scroll_pos: dependency: "direct main" description: @@ -1106,26 +1153,26 @@ packages: dependency: transitive description: name: shelf - sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" shelf_static: dependency: transitive description: name: shelf_static - sha256: e792b76b96a36d4a41b819da593aff4bdd413576b3ba6150df5d8d9996d2e74c + sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8 + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" simple_observable: dependency: transitive description: @@ -1151,42 +1198,42 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" sqflite: dependency: transitive description: name: sqflite - sha256: "78324387dc81df14f78df06019175a86a2ee0437624166c382e145d0a7fd9a4f" + sha256: "591f1602816e9c31377d5f008c2d9ef7b8aca8941c3f89cc5fd9d84da0c38a9a" url: "https://pub.dev" source: hosted - version: "2.2.4+1" + version: "2.3.0" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: bfd6973aaeeb93475bc0d875ac9aefddf7965ef22ce09790eb963992ffc5183f + sha256: "1b92f368f44b0dee2425bb861cfa17b6f6cf3961f762ff6f941d20b33355660a" url: "https://pub.dev" source: hosted - version: "2.4.2+2" + version: "2.5.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -1207,10 +1254,10 @@ packages: dependency: transitive description: name: synchronized - sha256: "33b31b6beb98100bf9add464a36a8dd03eb10c7a8cf15aeec535e9b054aaf04b" + sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "3.1.0" term_glyph: dependency: transitive description: @@ -1219,6 +1266,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + url: "https://pub.dev" + source: hosted + version: "0.6.1" texture_rgba_renderer: dependency: "direct main" description: @@ -1247,18 +1302,18 @@ packages: dependency: "direct main" description: name: tuple - sha256: "0ea99cd2f9352b2586583ab2ce6489d1f95a5f6de6fb9492faaf97ae2060f0aa" + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" typed_data: dependency: transitive description: name: typed_data - sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" uni_links: dependency: "direct main" description: @@ -1296,74 +1351,74 @@ packages: dependency: transitive description: name: universal_io - sha256: "79f78ddad839ee3aae3ec7c01eb4575faf0d5c860f8e5223bc9f9c17f7f03cef" + sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad" url: "https://pub.dev" source: hosted - version: "2.0.4" + version: "2.2.2" url_launcher: dependency: "direct main" description: name: url_launcher - sha256: "698fa0b4392effdc73e9e184403b627362eb5fbf904483ac9defbb1c2191d809" + sha256: "47e208a6711459d813ba18af120d9663c20bdf6985d6ad39fe165d2538378d27" url: "https://pub.dev" source: hosted - version: "6.1.8" + version: "6.1.14" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "3e2f6dfd2c7d9cd123296cab8ef66cfc2c1a13f5845f42c7a0f365690a8a7dd1" + sha256: b04af59516ab45762b2ca6da40fa830d72d0f6045cd97744450b73493fa76330 url: "https://pub.dev" source: hosted - version: "6.0.23" + version: "6.1.0" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: bb328b24d3bccc20bdf1024a0990ac4f869d57663660de9c936fb8c043edefe3 + sha256: "7c65021d5dee51813d652357bc65b8dd4a6177082a9966bc8ba6ee477baa795f" url: "https://pub.dev" source: hosted - version: "6.0.18" + version: "6.1.5" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: "318c42cba924e18180c029be69caf0a1a710191b9ec49bb42b5998fdcccee3cc" + sha256: b651aad005e0cb06a01dbd84b428a301916dc75f0e7ea6165f80057fee2d8e8e url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.6" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "41988b55570df53b3dd2a7fc90c76756a963de6a8c5f8e113330cb35992e2094" + sha256: b55486791f666e62e0e8ff825e58a023fd6b1f71c49926483f1128d3bbd8fe88 url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.7" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - sha256: "4eae912628763eb48fc214522e58e942fd16ce195407dbf45638239523c759a6" + sha256: "95465b39f83bfe95fcb9d174829d6476216f2d548b79c38ab2506e0458787618" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.5" url_launcher_web: dependency: transitive description: name: url_launcher_web - sha256: "44d79408ce9f07052095ef1f9a693c258d6373dc3944249374e30eff7219ccb0" + sha256: ba140138558fcc3eead51a1c42e92a9fb074a1b1149ed3c73e66035b2ccd94f2 url: "https://pub.dev" source: hosted - version: "2.0.14" + version: "2.0.19" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: b6217370f8eb1fd85c8890c539f5a639a01ab209a36db82c921ebeacefc7a615 + sha256: "95fef3129dc7cfaba2bc3d5ba2e16063bb561fc6d78e63eee16162bc70029069" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.8" uuid: dependency: "direct main" description: @@ -1376,26 +1431,26 @@ packages: dependency: transitive description: name: vector_graphics - sha256: ea8d3fc7b2e0f35de38a7465063ecfcf03d8217f7962aa2a6717132cb5d43a79 + sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" url: "https://pub.dev" source: hosted - version: "1.1.5" + version: "1.1.7" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: a5eaa5d19e123ad4f61c3718ca1ed921c4e6254238d9145f82aa214955d9aced + sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" url: "https://pub.dev" source: hosted - version: "1.1.5" + version: "1.1.7" vector_graphics_compiler: dependency: transitive description: name: vector_graphics_compiler - sha256: "15edc42f7eaa478ce854eaf1fbb9062a899c0e4e56e775dd73b7f4709c97c4ca" + sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" url: "https://pub.dev" source: hosted - version: "1.1.5" + version: "1.1.7" vector_math: dependency: transitive description: @@ -1408,26 +1463,26 @@ packages: dependency: transitive description: name: video_player - sha256: d3910a8cefc0de8a432a4411dcf85030e885d8fef3ddea291f162253a05dbf01 + sha256: "74b86e63529cf5885130c639d74cd2f9232e7c8a66cbecbddd1dcb9dbd060d1e" url: "https://pub.dev" source: hosted - version: "2.7.1" + version: "2.7.2" video_player_android: dependency: transitive description: name: video_player_android - sha256: "984388511230bac63feb53b2911a70e829fe0976b6b2213f5c579c4e0a882db3" + sha256: "3fe89ab07fdbce786e7eb25b58532d6eaf189ceddc091cb66cba712f8d9e8e55" url: "https://pub.dev" source: hosted - version: "2.3.10" + version: "2.4.10" video_player_avfoundation: dependency: transitive description: name: video_player_avfoundation - sha256: d9f7a46d6a77680adb03ec05a381025d6e890ebe636637c6c3014cc3926b97e9 + sha256: c3b123a5a56c9812b9029f840c65b92fd65083eb08d69be016b01e8aa018f77d url: "https://pub.dev" source: hosted - version: "2.3.8" + version: "2.4.10" video_player_platform_interface: dependency: transitive description: @@ -1440,10 +1495,10 @@ packages: dependency: transitive description: name: video_player_web - sha256: b649b07b8f8f553bee4a97a0a53d0fe78a70b115eafaf0105b612b32b05ddb99 + sha256: "9c34a243785feca23148bfcd772dbb803d63c9304488177ec4f3f4463802fcb7" url: "https://pub.dev" source: hosted - version: "2.0.13" + version: "2.0.17" visibility_detector: dependency: "direct main" description: @@ -1496,26 +1551,26 @@ packages: dependency: transitive description: name: watcher - sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.1.0" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: ca49c0bc209c687b887f30527fb6a9d80040b072cc2990f34b9bec3e7663101b + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.0" win32: dependency: "direct main" description: name: win32 - sha256: c9ebe7ee4ab0c2194e65d3a07d8c54c5d00bb001b76081c4a04cdb8448b59e46 + sha256: a6f0236dbda0f63aa9a25ad1ff9a9d8a4eaaa5012da0dc59d21afdb1dc361ca4 url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "3.1.4" win32_registry: dependency: transitive description: @@ -1529,10 +1584,10 @@ packages: description: path: "." ref: HEAD - resolved-ref: "02a95bd9674c16fe1b1d6d0db655c10fc8c270cb" + resolved-ref: f19acdb008645366339444a359a45c3257c8b32e url: "https://github.com/rustdesk-org/window_manager" source: git - version: "0.3.4" + version: "0.3.6" window_size: dependency: "direct main" description: @@ -1546,34 +1601,34 @@ packages: dependency: transitive description: name: xdg_directories - sha256: bd512f03919aac5f1313eb8249f223bacf4927031bf60b02601f81f687689e86 + sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" url: "https://pub.dev" source: hosted - version: "0.2.0+3" + version: "1.0.3" xml: dependency: transitive description: name: xml - sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5" + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" url: "https://pub.dev" source: hosted - version: "6.2.2" + version: "6.3.0" yaml: dependency: transitive description: name: yaml - sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" yaml_edit: dependency: transitive description: name: yaml_edit - sha256: "4240d1b19841b8af5786121e4e357735cc2a8ffb19176bff5769d73c34e2a8a5" + sha256: "1579d4a0340a83cf9e4d580ea51a16329c916973bffd5bd4b45e911b25d46bfd" url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.1.1" zxing2: dependency: "direct main" description: From 28ddf6cf079a5cad14e75b1e311596c026fef326 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 26 Sep 2023 10:26:42 +0800 Subject: [PATCH 27/71] fix a potential crash --- src/common.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.rs b/src/common.rs index 4172344d0..e5599389c 100644 --- a/src/common.rs +++ b/src/common.rs @@ -844,7 +844,7 @@ async fn check_software_update_() -> hbb_common::ResultType<()> { .path() .rsplit('/') .next() - .unwrap(); + .unwrap_or_default(); let response_url = latest_release_response.url().to_string(); From c470f2734dad25e6c7295f550f764349b66eff35 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 26 Sep 2023 10:41:29 +0800 Subject: [PATCH 28/71] revert pub lock to old, because the shit flutter bridge does not work --- flutter/pubspec.lock | 463 +++++++++++++++++++------------------------ 1 file changed, 204 insertions(+), 259 deletions(-) diff --git a/flutter/pubspec.lock b/flutter/pubspec.lock index df4a653e3..be91dfe19 100644 --- a/flutter/pubspec.lock +++ b/flutter/pubspec.lock @@ -29,34 +29,34 @@ packages: dependency: transitive description: name: animations - sha256: ef57563eed3620bd5d75ad96189846aca1e033c0c45fc9a7d26e80ab02b88a70 + sha256: fe8a6bdca435f718bb1dc8a11661b2c22504c6da40ef934cee8327ed77934164 url: "https://pub.dev" source: hosted - version: "2.0.8" + version: "2.0.7" archive: dependency: transitive description: name: archive - sha256: "20071638cbe4e5964a427cfa0e86dce55d060bc7d82d56f3554095d7239a8765" + sha256: d6347d54a2d8028e0437e3c099f66fdb8ae02c4720c1e7534c9f24c10351f85d url: "https://pub.dev" source: hosted - version: "3.4.2" + version: "3.3.6" args: dependency: transitive description: name: args - sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + sha256: c372bb384f273f0c2a8aaaa226dad84dc27c8519a691b888725dec59518ad53a url: "https://pub.dev" source: hosted - version: "2.4.2" + version: "2.4.1" async: dependency: transitive description: name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.10.0" auto_size_text: dependency: "direct main" description: @@ -69,10 +69,10 @@ packages: dependency: "direct main" description: name: auto_size_text_field - sha256: d47c81ffa9b61d219f6c50492dc03ea28fa9346561b2ec33b46ccdc000ddb0aa + sha256: "8967129167193fefbb7a8707ade1bb71f9e52b9a5cf6da0132b7f6b7946c5a3f" url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.2.1" back_button_interceptor: dependency: "direct main" description: @@ -81,22 +81,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.0.2" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" - source: hosted - version: "2.1.1" bot_toast: dependency: "direct main" description: name: bot_toast - sha256: "6b93030a99a98335b8827ecd83021e92e885ffc61d261d3825ffdecdd17f3bdf" + sha256: "19306147033316a7873c5d261b874fca3f341c05e4e1c12be56153ad11187edd" url: "https://pub.dev" source: hosted - version: "4.1.3" + version: "4.0.3" build: dependency: transitive description: @@ -133,10 +125,10 @@ packages: dependency: transitive description: name: build_resolvers - sha256: d912852cce27c9e80a93603db721c267716894462e7033165178b91138587972 + sha256: "6c4dd11d05d056e76320b828a1db0fc01ccd376922526f8e9d6c796a5adbac20" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.2.1" build_runner: dependency: "direct dev" description: @@ -149,10 +141,10 @@ packages: dependency: transitive description: name: build_runner_core - sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41" + sha256: "14febe0f5bac5ae474117a36099b4de6f1dbc52df6c5e55534b3da9591bf4292" url: "https://pub.dev" source: hosted - version: "7.2.10" + version: "7.2.7" built_collection: dependency: transitive description: @@ -165,34 +157,34 @@ packages: dependency: transitive description: name: built_value - sha256: a8de5955205b4d1dbbbc267daddf2178bd737e4bab8987c04a500478c9651e74 + sha256: "169565c8ad06adb760c3645bf71f00bff161b00002cace266cad42c5d22a7725" url: "https://pub.dev" source: hosted - version: "8.6.3" + version: "8.4.3" cached_network_image: dependency: transitive description: name: cached_network_image - sha256: f98972704692ba679db144261172a8e20feb145636c617af0eb4022132a6797f + sha256: fd3d0dc1d451f9a252b32d95d3f0c3c487bc41a75eba2e6097cb0b9c71491b15 url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "3.2.3" cached_network_image_platform_interface: dependency: transitive description: name: cached_network_image_platform_interface - sha256: "56aa42a7a01e3c9db8456d9f3f999931f1e05535b5a424271e9a38cabf066613" + sha256: bb2b8403b4ccdc60ef5f25c70dead1f3d32d24b9d6117cfc087f496b178594a7 url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "2.0.0" cached_network_image_web: dependency: transitive description: name: cached_network_image_web - sha256: "759b9a9f8f6ccbb66c185df805fac107f05730b1dab9c64626d1008cca532257" + sha256: b8eb814ebfcb4dea049680f8c1ffb2df399e4d03bf7a352c775e26fa06e02fa0 url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.0.2" characters: dependency: transitive description: @@ -213,10 +205,10 @@ packages: dependency: transitive description: name: checked_yaml - sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + sha256: "3d1505d91afa809d177efd4eed5bb0eb65805097a1463abdd2add076effae311" url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.0.2" cli_util: dependency: transitive description: @@ -237,10 +229,10 @@ packages: dependency: transitive description: name: code_builder - sha256: "1be9be30396d7e4c0db42c35ea6ccd7cc6a1e19916b5dc64d6ac216b5544d677" + sha256: "0d43dd1288fd145de1ecc9a3948ad4a6d5a82f0a14c4fdd0892260787d975cbe" url: "https://pub.dev" source: hosted - version: "4.7.0" + version: "4.4.0" collection: dependency: transitive description: @@ -277,34 +269,34 @@ packages: dependency: transitive description: name: cross_file - sha256: fd832b5384d0d6da4f6df60b854d33accaaeb63aa9e10e736a87381f08dee2cb + sha256: f71079978789bc2fe78d79227f1f8cfe195b31bbd8db2399b0d15a4b96fb843b url: "https://pub.dev" source: hosted - version: "0.3.3+5" + version: "0.3.3+2" crypto: dependency: transitive description: name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + sha256: aa274aa7774f8964e4f4f38cc994db7b6158dd36e9187aaceaddc994b35c6c67 url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.2" csslib: dependency: transitive description: name: csslib - sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + sha256: b36c7f7e24c0bdf1bf9a3da461c837d1de64b9f8beb190c9011d8c72a3dfd745 url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "0.17.2" dart_style: dependency: transitive description: name: dart_style - sha256: abd7625e16f51f554ea244d090292945ec4d4be7bfbaf2ec8cccea568919d334 + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.3.2" dash_chat_2: dependency: "direct main" description: @@ -400,10 +392,10 @@ packages: dependency: "direct main" description: name: dropdown_button2 - sha256: b0fe8d49a030315e9eef6c7ac84ca964250155a6224d491c1365061bc974a9e1 + sha256: "4458d81bfd24207f3d58f66f78097064e02f810f94cf1bc80bf20fe7685ebc80" url: "https://pub.dev" source: hosted - version: "2.3.9" + version: "2.0.0" dynamic_layouts: dependency: "direct main" description: @@ -433,10 +425,10 @@ packages: dependency: "direct main" description: name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.0.1" ffigen: dependency: "direct dev" description: @@ -457,50 +449,18 @@ packages: dependency: "direct main" description: name: file_picker - sha256: b85eb92b175767fdaa0c543bf3b0d1f610fe966412ea72845fe5ba7801e763ff + sha256: d090ae03df98b0247b82e5928f44d1b959867049d18d73635e2e0bc3f49542b9 url: "https://pub.dev" source: hosted - version: "5.2.10" - file_selector_linux: - dependency: transitive - description: - name: file_selector_linux - sha256: "045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492" - url: "https://pub.dev" - source: hosted - version: "0.9.2+1" - file_selector_macos: - dependency: transitive - description: - name: file_selector_macos - sha256: b15c3da8bd4908b9918111fa486903f5808e388b8d1c559949f584725a6594d6 - url: "https://pub.dev" - source: hosted - version: "0.9.3+3" - file_selector_platform_interface: - dependency: transitive - description: - name: file_selector_platform_interface - sha256: "0aa47a725c346825a2bd396343ce63ac00bda6eff2fbc43eabe99737dede8262" - url: "https://pub.dev" - source: hosted - version: "2.6.1" - file_selector_windows: - dependency: transitive - description: - name: file_selector_windows - sha256: d3547240c20cabf205c7c7f01a50ecdbc413755814d6677f3cb366f04abcead0 - url: "https://pub.dev" - source: hosted - version: "0.9.3+1" + version: "5.2.5" fixnum: dependency: transitive description: name: fixnum - sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + sha256: "04be3e934c52e082558cc9ee21f42f5c1cd7a1262f4c63cd0357c08d5bba81ec" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.0.1" flex_color_picker: dependency: "direct main" description: @@ -522,6 +482,14 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_blurhash: + dependency: transitive + description: + name: flutter_blurhash + sha256: "05001537bd3fac7644fa6558b09ec8c0a3f2eba78c0765f88912882b1331a5c6" + url: "https://pub.dev" + source: hosted + version: "0.7.0" flutter_breadcrumb: dependency: "direct main" description: @@ -534,10 +502,10 @@ packages: dependency: transitive description: name: flutter_cache_manager - sha256: "8207f27539deb83732fdda03e259349046a39a4c767269285f449ade355d54ba" + sha256: "32cd900555219333326a2d0653aaaf8671264c29befa65bbd9856d204a4c9fb3" url: "https://pub.dev" source: hosted - version: "3.3.1" + version: "3.3.0" flutter_custom_cursor: dependency: "direct main" description: @@ -559,10 +527,10 @@ packages: dependency: "direct main" description: name: flutter_keyboard_visibility - sha256: "4983655c26ab5b959252ee204c2fffa4afeb4413cd030455194ec0caa3b8e7cb" + sha256: "86b71bbaffa38e885f5c21b1182408b9be6951fd125432cf6652c636254cef2d" url: "https://pub.dev" source: hosted - version: "5.4.1" + version: "5.4.0" flutter_keyboard_visibility_linux: dependency: transitive description: @@ -615,10 +583,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.0.2" flutter_localizations: dependency: "direct main" description: flutter @@ -636,10 +604,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: f185ac890306b5779ecbd611f52502d8d4d63d27703ef73161ca0407e815f02c + sha256: "60fc7b78455b94e6de2333d2f95196d32cf5c22f4b0b0520a628804cb463503b" url: "https://pub.dev" source: hosted - version: "2.0.16" + version: "2.0.7" flutter_rust_bridge: dependency: "direct main" description: @@ -652,10 +620,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" + sha256: f991fdb1533c3caeee0cdc14b04f50f0c3916f0dbcbc05237ccbe4e3c6b93f3f url: "https://pub.dev" source: hosted - version: "2.0.7" + version: "2.0.5" flutter_web_plugins: dependency: transitive description: flutter @@ -697,34 +665,34 @@ packages: dependency: transitive description: name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.1" graphs: dependency: transitive description: name: graphs - sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + sha256: f9e130f3259f52d26f0cfc0e964513796dafed572fa52e45d2f8d6ca14db39b2 url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.2.0" html: dependency: transitive description: name: html - sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + sha256: d9793e10dbe0e6c364f4c59bf3e01fb33a9b2a674bc7a1081693dba0614b6269 url: "https://pub.dev" source: hosted - version: "0.15.4" + version: "0.15.1" http: dependency: "direct main" description: name: http - sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" url: "https://pub.dev" source: hosted - version: "0.13.6" + version: "0.13.5" http_multi_server: dependency: transitive description: @@ -745,82 +713,58 @@ packages: dependency: "direct dev" description: name: icons_launcher - sha256: af05397792f6d82b93375a8a0253b8db0d3f816ef1dd1bf5c35cbab55321d327 + sha256: f8ccfb80b56856b6eac586980bdd9c14f5ec24fb87127514055445ceb9424f4c url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.0" image: dependency: "direct main" description: name: image - sha256: "93d1141eb65fe62414d5492de96ca2bff97eba0ca9218a89ad407a6f201fcadf" + sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf url: "https://pub.dev" source: hosted - version: "4.1.2" + version: "4.0.17" image_picker: dependency: "direct main" description: name: image_picker - sha256: b6951e25b795d053a6ba03af5f710069c99349de9341af95155d52665cb4607c + sha256: f98d76672d309c8b7030c323b3394669e122d52b307d2bbd8d06bd70f5b2aabe url: "https://pub.dev" source: hosted - version: "0.8.9" + version: "0.8.6+1" image_picker_android: dependency: transitive description: name: image_picker_android - sha256: "0c7b83bbe2980c8a8e36e974f055e11e51675784e13a4762889feed0f3937ff2" + sha256: b1cbfec0f5aef427a18eb573f5445af8c9c568626bf3388553e40c263d3f7368 url: "https://pub.dev" source: hosted - version: "0.8.8+1" + version: "0.8.5+5" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - sha256: "869fe8a64771b7afbc99fc433a5f7be2fea4d1cb3d7c11a48b6b579eb9c797f0" + sha256: "7d319fb74955ca46d9bf7011497860e3923bb67feebcf068f489311065863899" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.1.10" image_picker_ios: dependency: transitive description: name: image_picker_ios - sha256: c5538cacefacac733c724be7484377923b476216ad1ead35a0d2eadcdc0fc497 + sha256: "39c013200046d14c58b71dc4fa3d00e425fc9c699d589136cd3ca018727c0493" url: "https://pub.dev" source: hosted - version: "0.8.8+2" - image_picker_linux: - dependency: transitive - description: - name: image_picker_linux - sha256: "4ed1d9bb36f7cd60aa6e6cd479779cc56a4cb4e4de8f49d487b1aaad831300fa" - url: "https://pub.dev" - source: hosted - version: "0.2.1+1" - image_picker_macos: - dependency: transitive - description: - name: image_picker_macos - sha256: "3f5ad1e8112a9a6111c46d0b57a7be2286a9a07fc6e1976fdf5be2bd31d4ff62" - url: "https://pub.dev" - source: hosted - version: "0.2.1+1" + version: "0.8.6+6" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - sha256: ed9b00e63977c93b0d2d2b343685bed9c324534ba5abafbb3dfbd6a780b1b514 + sha256: "7cef2f28f4f2fef99180f636c3d446b4ccbafd6ba0fad2adc9a80c4040f656b8" url: "https://pub.dev" source: hosted - version: "2.9.1" - image_picker_windows: - dependency: transitive - description: - name: image_picker_windows - sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" - url: "https://pub.dev" - source: hosted - version: "0.2.1+1" + version: "2.6.2" intl: dependency: transitive description: @@ -849,34 +793,34 @@ packages: dependency: transitive description: name: json_annotation - sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + sha256: c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317 url: "https://pub.dev" source: hosted - version: "4.8.1" + version: "4.8.0" lints: dependency: transitive description: name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.0.1" logging: dependency: transitive description: name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.1.1" matcher: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: c94db23593b89766cda57aab9ac311e3616cf87c6fa4e9749df032f66f30dcb8 url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.14" material_color_utilities: dependency: transitive description: @@ -913,10 +857,10 @@ packages: dependency: transitive description: name: octo_image - sha256: "45b40f99622f11901238e18d48f5f12ea36426d8eced9f4cbf58479c7aa2430d" + sha256: "107f3ed1330006a3bea63615e81cf637433f5135a52466c7caa0e7152bca9143" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "1.0.2" package_config: dependency: transitive description: @@ -969,50 +913,50 @@ packages: dependency: "direct main" description: name: path_provider - sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa + sha256: dcea5feb97d8abf90cab9e9030b497fb7c3cbf26b7a1fe9e3ef7dcb0a1ddec95 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.0.12" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "6b8b19bd80da4f11ce91b2d1fb931f3006911477cec227cce23d3253d80df3f1" + sha256: a776c088d671b27f6e3aa8881d64b87b3e80201c64e8869b811325de7a76c15e url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.0.22" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" + sha256: "62a68e7e1c6c459f9289859e2fae58290c981ce21d1697faf54910fe1faa4c74" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.1.1" path_provider_linux: dependency: transitive description: name: path_provider_linux - sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + sha256: ab0987bf95bc591da42dffb38c77398fc43309f0b9b894dcc5d6f40c4b26c379 url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.1.7" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" + sha256: f0abc8ebd7253741f05488b4813d936b4d07c6bae3e86148a09e342ee4b08e76 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.0.5" path_provider_windows: dependency: transitive description: name: path_provider_windows - sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + sha256: bcabbe399d4042b8ee687e17548d5d3f527255253b4a639f5f8d2094a9c2b45c url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.1.3" pedantic: dependency: transitive description: @@ -1025,42 +969,42 @@ packages: dependency: "direct main" description: name: percent_indicator - sha256: c37099ad833a883c9d71782321cb65c3a848c21b6939b6185f0ff6640d05814c + sha256: cec41f67181fbd5322aa68b355621d1a4eea827426b8eeb613f6cbe195ff7b4a url: "https://pub.dev" source: hosted - version: "4.2.3" + version: "4.2.2" petitparser: dependency: transitive description: name: petitparser - sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "5.1.0" platform: dependency: transitive description: name: platform - sha256: ae68c7bfcd7383af3629daafb32fb4e8681c7154428da4febcff06200585f102 + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d + sha256: dbf0f707c78beedc9200146ad3cb0ab4d5da13c246336987be6940f026500d3a url: "https://pub.dev" source: hosted - version: "2.1.6" + version: "2.1.3" pointycastle: dependency: transitive description: name: pointycastle - sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" + sha256: db7306cf0249f838d1a24af52b5a5887c5bf7f31d8bb4e827d071dc0939ad346 url: "https://pub.dev" source: hosted - version: "3.7.3" + version: "3.6.2" pool: dependency: transitive description: @@ -1069,6 +1013,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.1" + process: + dependency: transitive + description: + name: process + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + url: "https://pub.dev" + source: hosted + version: "4.2.4" provider: dependency: "direct main" description: @@ -1081,26 +1033,26 @@ packages: dependency: transitive description: name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + sha256: "307de764d305289ff24ad257ad5c5793ce56d04947599ad68b3baa124105fc17" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.3" pubspec_parse: dependency: transitive description: name: pubspec_parse - sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + sha256: "75f6614d6dde2dc68948dffbaa4fe5dae32cd700eb9fb763fe11dfb45a3c4d0a" url: "https://pub.dev" source: hosted - version: "1.2.3" + version: "1.2.1" puppeteer: dependency: transitive description: name: puppeteer - sha256: dd49117259867d0ce0de33ddd95628fb70cff94581a6432c08272447b8dd1d27 + sha256: "4e235aaf9a338a45c9eb1ee38956e0ba369867bf144d7a27fdaf245409b2b87b" url: "https://pub.dev" source: hosted - version: "2.24.0" + version: "2.21.0" qr_code_scanner: dependency: "direct main" description: @@ -1128,11 +1080,12 @@ packages: screen_retriever: dependency: transitive description: - name: screen_retriever - sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90" - url: "https://pub.dev" - source: hosted - version: "0.1.9" + path: "." + ref: "406b9b0" + resolved-ref: "406b9b038b2c1d779f1e7bf609c8c248be247372" + url: "https://github.com/Kingtous/rustdesk_screen_retriever.git" + source: git + version: "0.1.2" scroll_pos: dependency: "direct main" description: @@ -1153,26 +1106,26 @@ packages: dependency: transitive description: name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + sha256: c24a96135a2ccd62c64b69315a14adc5c3419df63b4d7c05832a346fdb73682c url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.0" shelf_static: dependency: transitive description: name: shelf_static - sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e + sha256: e792b76b96a36d4a41b819da593aff4bdd413576b3ba6150df5d8d9996d2e74c url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.1" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + sha256: a988c0e8d8ffbdb8a28aa7ec8e449c260f3deb808781fe1284d22c5bba7156e8 url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.3" simple_observable: dependency: transitive description: @@ -1198,42 +1151,42 @@ packages: dependency: transitive description: name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.9.1" sqflite: dependency: transitive description: name: sqflite - sha256: "591f1602816e9c31377d5f008c2d9ef7b8aca8941c3f89cc5fd9d84da0c38a9a" + sha256: "78324387dc81df14f78df06019175a86a2ee0437624166c382e145d0a7fd9a4f" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.2.4+1" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: "1b92f368f44b0dee2425bb861cfa17b6f6cf3961f762ff6f941d20b33355660a" + sha256: bfd6973aaeeb93475bc0d875ac9aefddf7965ef22ce09790eb963992ffc5183f url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.4.2+2" stack_trace: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.1" stream_transform: dependency: transitive description: @@ -1254,10 +1207,10 @@ packages: dependency: transitive description: name: synchronized - sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" + sha256: "33b31b6beb98100bf9add464a36a8dd03eb10c7a8cf15aeec535e9b054aaf04b" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.0.1" term_glyph: dependency: transitive description: @@ -1266,14 +1219,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.1" - test_api: - dependency: transitive - description: - name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" - url: "https://pub.dev" - source: hosted - version: "0.6.1" texture_rgba_renderer: dependency: "direct main" description: @@ -1302,18 +1247,18 @@ packages: dependency: "direct main" description: name: tuple - sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 + sha256: "0ea99cd2f9352b2586583ab2ce6489d1f95a5f6de6fb9492faaf97ae2060f0aa" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.0.1" typed_data: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.3.1" uni_links: dependency: "direct main" description: @@ -1351,74 +1296,74 @@ packages: dependency: transitive description: name: universal_io - sha256: "1722b2dcc462b4b2f3ee7d188dad008b6eb4c40bbd03a3de451d82c78bba9aad" + sha256: "79f78ddad839ee3aae3ec7c01eb4575faf0d5c860f8e5223bc9f9c17f7f03cef" url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.0.4" url_launcher: dependency: "direct main" description: name: url_launcher - sha256: "47e208a6711459d813ba18af120d9663c20bdf6985d6ad39fe165d2538378d27" + sha256: "698fa0b4392effdc73e9e184403b627362eb5fbf904483ac9defbb1c2191d809" url: "https://pub.dev" source: hosted - version: "6.1.14" + version: "6.1.8" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: b04af59516ab45762b2ca6da40fa830d72d0f6045cd97744450b73493fa76330 + sha256: "3e2f6dfd2c7d9cd123296cab8ef66cfc2c1a13f5845f42c7a0f365690a8a7dd1" url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "6.0.23" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "7c65021d5dee51813d652357bc65b8dd4a6177082a9966bc8ba6ee477baa795f" + sha256: bb328b24d3bccc20bdf1024a0990ac4f869d57663660de9c936fb8c043edefe3 url: "https://pub.dev" source: hosted - version: "6.1.5" + version: "6.0.18" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: b651aad005e0cb06a01dbd84b428a301916dc75f0e7ea6165f80057fee2d8e8e + sha256: "318c42cba924e18180c029be69caf0a1a710191b9ec49bb42b5998fdcccee3cc" url: "https://pub.dev" source: hosted - version: "3.0.6" + version: "3.0.2" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: b55486791f666e62e0e8ff825e58a023fd6b1f71c49926483f1128d3bbd8fe88 + sha256: "41988b55570df53b3dd2a7fc90c76756a963de6a8c5f8e113330cb35992e2094" url: "https://pub.dev" source: hosted - version: "3.0.7" + version: "3.0.2" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - sha256: "95465b39f83bfe95fcb9d174829d6476216f2d548b79c38ab2506e0458787618" + sha256: "4eae912628763eb48fc214522e58e942fd16ce195407dbf45638239523c759a6" url: "https://pub.dev" source: hosted - version: "2.1.5" + version: "2.1.1" url_launcher_web: dependency: transitive description: name: url_launcher_web - sha256: ba140138558fcc3eead51a1c42e92a9fb074a1b1149ed3c73e66035b2ccd94f2 + sha256: "44d79408ce9f07052095ef1f9a693c258d6373dc3944249374e30eff7219ccb0" url: "https://pub.dev" source: hosted - version: "2.0.19" + version: "2.0.14" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: "95fef3129dc7cfaba2bc3d5ba2e16063bb561fc6d78e63eee16162bc70029069" + sha256: b6217370f8eb1fd85c8890c539f5a639a01ab209a36db82c921ebeacefc7a615 url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.0.3" uuid: dependency: "direct main" description: @@ -1431,26 +1376,26 @@ packages: dependency: transitive description: name: vector_graphics - sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" + sha256: ea8d3fc7b2e0f35de38a7465063ecfcf03d8217f7962aa2a6717132cb5d43a79 url: "https://pub.dev" source: hosted - version: "1.1.7" + version: "1.1.5" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" + sha256: a5eaa5d19e123ad4f61c3718ca1ed921c4e6254238d9145f82aa214955d9aced url: "https://pub.dev" source: hosted - version: "1.1.7" + version: "1.1.5" vector_graphics_compiler: dependency: transitive description: name: vector_graphics_compiler - sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" + sha256: "15edc42f7eaa478ce854eaf1fbb9062a899c0e4e56e775dd73b7f4709c97c4ca" url: "https://pub.dev" source: hosted - version: "1.1.7" + version: "1.1.5" vector_math: dependency: transitive description: @@ -1463,26 +1408,26 @@ packages: dependency: transitive description: name: video_player - sha256: "74b86e63529cf5885130c639d74cd2f9232e7c8a66cbecbddd1dcb9dbd060d1e" + sha256: d3910a8cefc0de8a432a4411dcf85030e885d8fef3ddea291f162253a05dbf01 url: "https://pub.dev" source: hosted - version: "2.7.2" + version: "2.7.1" video_player_android: dependency: transitive description: name: video_player_android - sha256: "3fe89ab07fdbce786e7eb25b58532d6eaf189ceddc091cb66cba712f8d9e8e55" + sha256: "984388511230bac63feb53b2911a70e829fe0976b6b2213f5c579c4e0a882db3" url: "https://pub.dev" source: hosted - version: "2.4.10" + version: "2.3.10" video_player_avfoundation: dependency: transitive description: name: video_player_avfoundation - sha256: c3b123a5a56c9812b9029f840c65b92fd65083eb08d69be016b01e8aa018f77d + sha256: d9f7a46d6a77680adb03ec05a381025d6e890ebe636637c6c3014cc3926b97e9 url: "https://pub.dev" source: hosted - version: "2.4.10" + version: "2.3.8" video_player_platform_interface: dependency: transitive description: @@ -1495,10 +1440,10 @@ packages: dependency: transitive description: name: video_player_web - sha256: "9c34a243785feca23148bfcd772dbb803d63c9304488177ec4f3f4463802fcb7" + sha256: b649b07b8f8f553bee4a97a0a53d0fe78a70b115eafaf0105b612b32b05ddb99 url: "https://pub.dev" source: hosted - version: "2.0.17" + version: "2.0.13" visibility_detector: dependency: "direct main" description: @@ -1551,26 +1496,26 @@ packages: dependency: transitive description: name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.0.2" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + sha256: ca49c0bc209c687b887f30527fb6a9d80040b072cc2990f34b9bec3e7663101b url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.3.0" win32: dependency: "direct main" description: name: win32 - sha256: a6f0236dbda0f63aa9a25ad1ff9a9d8a4eaaa5012da0dc59d21afdb1dc361ca4 + sha256: c9ebe7ee4ab0c2194e65d3a07d8c54c5d00bb001b76081c4a04cdb8448b59e46 url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "3.1.3" win32_registry: dependency: transitive description: @@ -1601,34 +1546,34 @@ packages: dependency: transitive description: name: xdg_directories - sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" + sha256: bd512f03919aac5f1313eb8249f223bacf4927031bf60b02601f81f687689e86 url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "0.2.0+3" xml: dependency: transitive description: name: xml - sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5" url: "https://pub.dev" source: hosted - version: "6.3.0" + version: "6.2.2" yaml: dependency: transitive description: name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.1" yaml_edit: dependency: transitive description: name: yaml_edit - sha256: "1579d4a0340a83cf9e4d580ea51a16329c916973bffd5bd4b45e911b25d46bfd" + sha256: "4240d1b19841b8af5786121e4e357735cc2a8ffb19176bff5769d73c34e2a8a5" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.0.3" zxing2: dependency: "direct main" description: From f21f793343ab67cf2959d19a703352e011c5daf1 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 26 Sep 2023 10:47:45 +0800 Subject: [PATCH 29/71] remove check update from periodical call --- flutter/lib/desktop/pages/desktop_home_page.dart | 9 ++++----- flutter/lib/mobile/pages/connection_page.dart | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index e48dda51d..c5d3718eb 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -499,13 +499,12 @@ class _DesktopHomePageState extends State @override void initState() { super.initState(); + Timer(const Duration(seconds: 1), () async { + updateUrl = await bind.mainGetSoftwareUpdateUrl(); + if (updateUrl.isNotEmpty) setState(() {}); + }); _updateTimer = periodic_immediate(const Duration(seconds: 1), () async { await gFFI.serverModel.fetchID(); - final url = await bind.mainGetSoftwareUpdateUrl(); - if (updateUrl != url) { - updateUrl = url; - setState(() {}); - } final error = await bind.mainGetError(); if (systemError != error) { systemError = error; diff --git a/flutter/lib/mobile/pages/connection_page.dart b/flutter/lib/mobile/pages/connection_page.dart index 5a61a2fc8..c9bd15709 100644 --- a/flutter/lib/mobile/pages/connection_page.dart +++ b/flutter/lib/mobile/pages/connection_page.dart @@ -57,7 +57,7 @@ class _ConnectionPageState extends State { }(); } if (isAndroid) { - Timer(const Duration(seconds: 5), () async { + Timer(const Duration(seconds: 1), () async { _updateUrl = await bind.mainGetSoftwareUpdateUrl(); if (_updateUrl.isNotEmpty) setState(() {}); }); From 4e97d2503bfa805b985c78f373b9d9f124aa7cd7 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Tue, 26 Sep 2023 11:02:52 +0800 Subject: [PATCH 30/71] chore --- flutter/pubspec.lock | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/flutter/pubspec.lock b/flutter/pubspec.lock index be91dfe19..1ee837be7 100644 --- a/flutter/pubspec.lock +++ b/flutter/pubspec.lock @@ -1080,12 +1080,11 @@ packages: screen_retriever: dependency: transitive description: - path: "." - ref: "406b9b0" - resolved-ref: "406b9b038b2c1d779f1e7bf609c8c248be247372" - url: "https://github.com/Kingtous/rustdesk_screen_retriever.git" - source: git - version: "0.1.2" + name: screen_retriever + sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90" + url: "https://pub.dev" + source: hosted + version: "0.1.9" scroll_pos: dependency: "direct main" description: From e000fdfb5056b679178c7c78851004b220454987 Mon Sep 17 00:00:00 2001 From: 21pages Date: Tue, 26 Sep 2023 15:11:31 +0800 Subject: [PATCH 31/71] desktop tab lable format: id/alias@hostname Signed-off-by: 21pages --- flutter/lib/common.dart | 20 +++++++++++- .../desktop/pages/file_manager_tab_page.dart | 2 +- .../lib/desktop/pages/port_forward_page.dart | 2 +- .../desktop/pages/port_forward_tab_page.dart | 2 +- .../lib/desktop/pages/remote_tab_page.dart | 2 +- .../lib/desktop/widgets/tabbar_widget.dart | 31 ++++++++++--------- flutter/lib/models/model.dart | 11 +++++-- src/flutter_ffi.rs | 4 +-- 8 files changed, 50 insertions(+), 24 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index af0be2519..4f407b59b 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -2303,7 +2303,7 @@ String getWindowName({WindowType? overrideType}) { } String getWindowNameWithId(String id, {WindowType? overrideType}) { - return "${DesktopTab.labelGetterAlias(id).value} - ${getWindowName(overrideType: overrideType)}"; + return "${DesktopTab.tablabelGetter(id).value} - ${getWindowName(overrideType: overrideType)}"; } Future updateSystemWindowTheme() async { @@ -2536,3 +2536,21 @@ Widget buildErrorBanner(BuildContext context, )).marginOnly(bottom: 14), )); } + +String getDesktopTabLabel(String peerId, String alias) { + String label = alias.isEmpty ? peerId : alias; + try { + String peer = bind.mainGetPeerSync(id: peerId); + Map config = jsonDecode(peer); + if (config['info']['hostname'] is String) { + String hostname = config['info']['hostname']; + if (hostname.isNotEmpty && + !label.toLowerCase().contains(hostname.toLowerCase())) { + label += "@$hostname"; + } + } + } catch (e) { + debugPrint("Failed to get hostname:$e"); + } + return label; +} diff --git a/flutter/lib/desktop/pages/file_manager_tab_page.dart b/flutter/lib/desktop/pages/file_manager_tab_page.dart index 1e349c6f0..5af937269 100644 --- a/flutter/lib/desktop/pages/file_manager_tab_page.dart +++ b/flutter/lib/desktop/pages/file_manager_tab_page.dart @@ -99,7 +99,7 @@ class _FileManagerTabPageState extends State { controller: tabController, onWindowCloseButton: handleWindowCloseButton, tail: const AddButton().paddingOnly(left: 10), - labelGetter: DesktopTab.labelGetterAlias, + labelGetter: DesktopTab.tablabelGetter, )), ); return Platform.isMacOS || kUseCompatibleUiMode diff --git a/flutter/lib/desktop/pages/port_forward_page.dart b/flutter/lib/desktop/pages/port_forward_page.dart index 2a173c53b..0e74d4a8f 100644 --- a/flutter/lib/desktop/pages/port_forward_page.dart +++ b/flutter/lib/desktop/pages/port_forward_page.dart @@ -266,7 +266,7 @@ class _PortForwardPageState extends State } void refreshTunnelConfig() async { - String peer = await bind.mainGetPeer(id: widget.id); + String peer = bind.mainGetPeerSync(id: widget.id); Map config = jsonDecode(peer); List infos = config['port_forwards'] as List; List<_PortForward> result = List.empty(growable: true); diff --git a/flutter/lib/desktop/pages/port_forward_tab_page.dart b/flutter/lib/desktop/pages/port_forward_tab_page.dart index 621f393e0..886b2693d 100644 --- a/flutter/lib/desktop/pages/port_forward_tab_page.dart +++ b/flutter/lib/desktop/pages/port_forward_tab_page.dart @@ -108,7 +108,7 @@ class _PortForwardTabPageState extends State { return true; }, tail: AddButton().paddingOnly(left: 10), - labelGetter: DesktopTab.labelGetterAlias, + labelGetter: DesktopTab.tablabelGetter, )), ); return Platform.isMacOS || kUseCompatibleUiMode diff --git a/flutter/lib/desktop/pages/remote_tab_page.dart b/flutter/lib/desktop/pages/remote_tab_page.dart index 063fe49d8..509ef0120 100644 --- a/flutter/lib/desktop/pages/remote_tab_page.dart +++ b/flutter/lib/desktop/pages/remote_tab_page.dart @@ -210,7 +210,7 @@ class _ConnectionTabPageState extends State { onWindowCloseButton: handleWindowCloseButton, tail: const AddButton().paddingOnly(left: 10), pageViewBuilder: (pageView) => pageView, - labelGetter: DesktopTab.labelGetterAlias, + labelGetter: DesktopTab.tablabelGetter, tabBuilder: (key, icon, label, themeConf) => Obx(() { final connectionType = ConnectionTypeState.find(key); if (!connectionType.isValid()) { diff --git a/flutter/lib/desktop/widgets/tabbar_widget.dart b/flutter/lib/desktop/widgets/tabbar_widget.dart index be089559b..ce0dbe027 100644 --- a/flutter/lib/desktop/widgets/tabbar_widget.dart +++ b/flutter/lib/desktop/widgets/tabbar_widget.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:convert'; import 'dart:io'; import 'dart:math'; import 'dart:ui' as ui; @@ -267,13 +268,12 @@ class DesktopTab extends StatelessWidget { tabType == DesktopTabType.install; } - static RxString labelGetterAlias(String peerId) { - final opt = 'alias'; - PeerStringOption.init(peerId, opt, () { - final alias = bind.mainGetPeerOptionSync(id: peerId, key: opt); - return alias.isEmpty ? peerId : alias; + static RxString tablabelGetter(String peerId) { + PeerStringOption.init(peerId, 'tabLabel', () { + final alias = bind.mainGetPeerOptionSync(id: peerId, key: 'alias'); + return getDesktopTabLabel(peerId, alias); }); - return PeerStringOption.find(peerId, opt); + return PeerStringOption.find(peerId, 'tabLabel'); } @override @@ -921,14 +921,17 @@ class _TabState extends State<_Tab> with RestorationMixin { final labelWidget = Obx(() { return ConstrainedBox( constraints: BoxConstraints(maxWidth: widget.maxLabelWidth ?? 200), - child: Text( - translate(widget.label.value), - textAlign: TextAlign.center, - style: TextStyle( - color: isSelected - ? MyTheme.tabbar(context).selectedTextColor - : MyTheme.tabbar(context).unSelectedTextColor), - overflow: TextOverflow.ellipsis, + child: Tooltip( + message: translate(widget.label.value), + child: Text( + translate(widget.label.value), + textAlign: TextAlign.center, + style: TextStyle( + color: isSelected + ? MyTheme.tabbar(context).selectedTextColor + : MyTheme.tabbar(context).unSelectedTextColor), + overflow: TextOverflow.ellipsis, + ), )); }); diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index 67f195dd6..dab3a3e9b 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -8,6 +8,7 @@ import 'package:desktop_multi_window/desktop_multi_window.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_hbb/consts.dart'; +import 'package:flutter_hbb/desktop/widgets/tabbar_widget.dart'; import 'package:flutter_hbb/generated_bridge.dart'; import 'package:flutter_hbb/models/ab_model.dart'; import 'package:flutter_hbb/models/chat_model.dart'; @@ -353,9 +354,13 @@ class FfiModel with ChangeNotifier { } handleAliasChanged(Map evt) { - final rxAlias = PeerStringOption.find(evt['id'], 'alias'); - if (rxAlias.value != evt['alias']) { - rxAlias.value = evt['alias']; + if (!isDesktop) return; + final String peerId = evt['id']; + final String alias = evt['alias']; + String label = getDesktopTabLabel(peerId, alias); + final rxTabLabel = PeerStringOption.find(evt['id'], 'tabLabel'); + if (rxTabLabel.value != label) { + rxTabLabel.value = label; } } diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index 4186e93d2..9ebbc4b8a 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -729,9 +729,9 @@ pub fn main_store_fav(favs: Vec) { store_fav(favs) } -pub fn main_get_peer(id: String) -> String { +pub fn main_get_peer_sync(id: String) -> SyncReturn { let conf = get_peer(id); - serde_json::to_string(&conf).unwrap_or("".to_string()) + SyncReturn(serde_json::to_string(&conf).unwrap_or("".to_string())) } pub fn main_get_lan_peers() -> String { From 93f2b288b5e6ba801bfbdb15c346078fbaaab599 Mon Sep 17 00:00:00 2001 From: 21pages Date: Tue, 26 Sep 2023 09:26:53 +0800 Subject: [PATCH 32/71] show username followed by a 'Me' tag, use first letter as avatar Signed-off-by: 21pages --- flutter/lib/common.dart | 7 +++++ flutter/lib/common/widgets/my_group.dart | 40 ++++++++++++++++++++++-- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index af0be2519..e7df3170a 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -102,6 +102,7 @@ class ColorThemeExtension extends ThemeExtension { required this.drag_indicator, required this.shadow, required this.errorBannerBg, + required this.me, }); final Color? border; @@ -110,6 +111,7 @@ class ColorThemeExtension extends ThemeExtension { final Color? drag_indicator; final Color? shadow; final Color? errorBannerBg; + final Color? me; static final light = ColorThemeExtension( border: Color(0xFFCCCCCC), @@ -118,6 +120,7 @@ class ColorThemeExtension extends ThemeExtension { drag_indicator: Colors.grey[800], shadow: Colors.black, errorBannerBg: Color(0xFFFDEEEB), + me: Colors.green, ); static final dark = ColorThemeExtension( @@ -127,6 +130,7 @@ class ColorThemeExtension extends ThemeExtension { drag_indicator: Colors.grey, shadow: Colors.grey, errorBannerBg: Color(0xFF470F2D), + me: Colors.greenAccent, ); @override @@ -137,6 +141,7 @@ class ColorThemeExtension extends ThemeExtension { Color? drag_indicator, Color? shadow, Color? errorBannerBg, + Color? me, }) { return ColorThemeExtension( border: border ?? this.border, @@ -145,6 +150,7 @@ class ColorThemeExtension extends ThemeExtension { drag_indicator: drag_indicator ?? this.drag_indicator, shadow: shadow ?? this.shadow, errorBannerBg: errorBannerBg ?? this.errorBannerBg, + me: me ?? this.me, ); } @@ -161,6 +167,7 @@ class ColorThemeExtension extends ThemeExtension { drag_indicator: Color.lerp(drag_indicator, other.drag_indicator, t), shadow: Color.lerp(shadow, other.shadow, t), errorBannerBg: Color.lerp(shadow, other.errorBannerBg, t), + me: Color.lerp(shadow, other.me, t), ); } } diff --git a/flutter/lib/common/widgets/my_group.dart b/flutter/lib/common/widgets/my_group.dart index 8cd997be3..18b038623 100644 --- a/flutter/lib/common/widgets/my_group.dart +++ b/flutter/lib/common/widgets/my_group.dart @@ -182,6 +182,7 @@ class _MyGroupState extends State { () { bool selected = selectedUser.value == username; final isMe = username == gFFI.userModel.userName.value; + final colorMe = MyTheme.color(context).me!; return Container( decoration: BoxDecoration( color: selected ? MyTheme.color(context).highlight : null, @@ -193,9 +194,42 @@ class _MyGroupState extends State { child: Container( child: Row( children: [ - Icon(Icons.person_rounded, color: Colors.grey, size: 16) - .marginOnly(right: 4), - Expanded(child: Text(isMe ? translate('Me') : username)), + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + color: str2color(username, 0xAF), + shape: BoxShape.circle, + ), + child: Align( + alignment: Alignment.center, + child: Center( + child: Text( + username.characters.first.toUpperCase(), + style: TextStyle(color: Colors.white), + textAlign: TextAlign.center, + ), + ), + ), + ).marginOnly(right: 4), + if (isMe) Flexible(child: Text(username)), + if (isMe) + Flexible( + child: Container( + margin: EdgeInsets.only(left: 5), + padding: EdgeInsets.symmetric(horizontal: 3, vertical: 1), + decoration: BoxDecoration( + color: colorMe.withAlpha(20), + borderRadius: BorderRadius.all(Radius.circular(2)), + border: Border.all(color: colorMe.withAlpha(100))), + child: Text( + translate('Me'), + style: TextStyle( + color: colorMe.withAlpha(200), fontSize: 12), + ), + ), + ), + if (!isMe) Expanded(child: Text(username)), ], ).paddingSymmetric(vertical: 4), ), From 731ecfda64f67cd2bbadfcf2a63d64b345480633 Mon Sep 17 00:00:00 2001 From: dignow Date: Wed, 27 Sep 2023 09:16:51 +0800 Subject: [PATCH 33/71] use await to guarantee the calling order Signed-off-by: dignow --- flutter/lib/models/model.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index dab3a3e9b..0f6cc5b9c 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -203,11 +203,11 @@ class FfiModel with ChangeNotifier { }, sessionId, peerId); updatePrivacyMode(data.updatePrivacyMode, sessionId, peerId); setConnectionType(peerId, data.secure, data.direct); - handlePeerInfo(data.peerInfo, peerId); + await handlePeerInfo(data.peerInfo, peerId); for (var element in data.cursorDataList) { - handleCursorData(element); + await handleCursorData(element); } - handleCursorId(data.lastCursorId); + await handleCursorId(data.lastCursorId); } // todo: why called by two position @@ -1802,7 +1802,7 @@ class FFI { debugPrint('Unreachable, the cached data cannot be decoded.'); return; } - ffiModel.handleCachedPeerData(data, id); + await ffiModel.handleCachedPeerData(data, id); await bind.sessionRefresh(sessionId: sessionId); }); isToNewWindowNotified.value = true; From 3eeb0628f538169d01072497da4bcb25cf4e4ce0 Mon Sep 17 00:00:00 2001 From: 21pages Date: Tue, 26 Sep 2023 19:58:51 +0800 Subject: [PATCH 34/71] adjust scrollbar style, peers view support touch pad scroll, settings tab remove horizontal touch pad scroll Signed-off-by: 21pages --- flutter/lib/common.dart | 22 ++++++++++-- flutter/lib/common/widgets/peers_view.dart | 36 ++++++++++++++----- .../desktop/pages/desktop_setting_page.dart | 15 +++++--- flutter/pubspec.lock | 10 +++--- flutter/pubspec.yaml | 5 ++- 5 files changed, 66 insertions(+), 22 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index ca8c046d0..102b25bc9 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -273,11 +273,29 @@ class MyTheme { : EdgeInsets.only(left: dialogPadding / 3); static ScrollbarThemeData scrollbarTheme = ScrollbarThemeData( - thickness: MaterialStateProperty.all(kScrollbarThickness), + thickness: MaterialStateProperty.all(6), + thumbColor: MaterialStateProperty.resolveWith((states) { + if (states.contains(MaterialState.dragged)) { + return Colors.grey[900]; + } else if (states.contains(MaterialState.hovered)) { + return Colors.grey[700]; + } else { + return Colors.grey[500]; + } + }), + crossAxisMargin: 4, ); static ScrollbarThemeData scrollbarThemeDark = scrollbarTheme.copyWith( - thumbColor: MaterialStateProperty.all(Colors.grey[500]), + thumbColor: MaterialStateProperty.resolveWith((states) { + if (states.contains(MaterialState.dragged)) { + return Colors.grey[100]; + } else if (states.contains(MaterialState.hovered)) { + return Colors.grey[300]; + } else { + return Colors.grey[500]; + } + }), ); static ThemeData lightTheme = ThemeData( diff --git a/flutter/lib/common/widgets/peers_view.dart b/flutter/lib/common/widgets/peers_view.dart index 1138663ff..2cf1a45c3 100644 --- a/flutter/lib/common/widgets/peers_view.dart +++ b/flutter/lib/common/widgets/peers_view.dart @@ -4,6 +4,7 @@ import 'dart:collection'; import 'package:dynamic_layouts/dynamic_layouts.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_hbb/desktop/widgets/scroll_wrapper.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; import 'package:visibility_detector/visibility_detector.dart'; @@ -95,6 +96,8 @@ class _PeersViewState extends State<_PeersView> with WindowListener { return width; }(); + final _scrollController = ScrollController(); + _PeersViewState() { _startCheckOnlines(); } @@ -197,14 +200,31 @@ class _PeersViewState extends State<_PeersView> with WindowListener { : SizedBox(width: mobileWidth, child: visibilityChild); } - final child = DynamicGridView.builder( - gridDelegate: SliverGridDelegateWithWrapping( - mainAxisSpacing: space / 2, crossAxisSpacing: space), - itemCount: peers.length, - itemBuilder: (BuildContext context, int index) { - return buildOnePeer(peers[index]); - }, - ); + final Widget child; + if (isMobile) { + child = DynamicGridView.builder( + gridDelegate: SliverGridDelegateWithWrapping( + mainAxisSpacing: space / 2, crossAxisSpacing: space), + itemCount: peers.length, + itemBuilder: (BuildContext context, int index) { + return buildOnePeer(peers[index]); + }, + ); + } else { + child = DesktopScrollWrapper( + scrollController: _scrollController, + child: DynamicGridView.builder( + controller: _scrollController, + physics: DraggableNeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithWrapping( + mainAxisSpacing: space / 2, crossAxisSpacing: space), + itemCount: peers.length, + itemBuilder: (BuildContext context, int index) { + return buildOnePeer(peers[index]); + }), + ); + } + if (updateEvent == UpdateEvent.load) { _curPeers.clear(); _curPeers.addAll(peers.map((e) => e.id)); diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index 035a21f41..ca41ff227 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -88,6 +88,11 @@ class _DesktopSettingPageState extends State Get.put(selectedIndex, tag: _kSettingPageIndexTag); controller = PageController(initialPage: widget.initialPage); Get.put(controller, tag: _kSettingPageControllerTag); + controller.addListener(() { + if (controller.page != null) { + selectedIndex.value = controller.page!.toInt(); + } + }); } @override @@ -154,7 +159,7 @@ class _DesktopSettingPageState extends State scrollController: controller, child: PageView( controller: controller, - physics: DraggableNeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), children: _children(), )), ), @@ -330,9 +335,11 @@ class _GeneralState extends State<_General> { child: _OptionCheckBox(context, "Always use software rendering", 'allow-always-software-render'), )); - children.add( - _OptionCheckBox(context, 'Check for software update on startup','enable-check-update', - isServer: false, + children.add(_OptionCheckBox( + context, + 'Check for software update on startup', + 'enable-check-update', + isServer: false, )); if (bind.mainShowOption(key: 'allow-linux-headless')) { children.add(_OptionCheckBox( diff --git a/flutter/pubspec.lock b/flutter/pubspec.lock index 1ee837be7..ada1dd512 100644 --- a/flutter/pubspec.lock +++ b/flutter/pubspec.lock @@ -399,12 +399,12 @@ packages: dynamic_layouts: dependency: "direct main" description: - path: "packages/dynamic_layouts" - ref: "74cc4b495dcf3a4cb8df38d9ecc89f53f074a2c6" - resolved-ref: "74cc4b495dcf3a4cb8df38d9ecc89f53f074a2c6" - url: "https://github.com/21pages/packages.git" + path: "." + ref: "24cb88413fa5181d949ddacbb30a65d5c459e7d9" + resolved-ref: "24cb88413fa5181d949ddacbb30a65d5c459e7d9" + url: "https://github.com/21pages/dynamic_layouts.git" source: git - version: "0.0.1+2" + version: "0.0.1+1" event_bus: dependency: transitive description: diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index 3969c288a..478c9703c 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -102,9 +102,8 @@ dependencies: flex_color_picker: ^3.3.0 dynamic_layouts: git: - url: https://github.com/21pages/packages.git - path: packages/dynamic_layouts - ref: 74cc4b495dcf3a4cb8df38d9ecc89f53f074a2c6 + url: https://github.com/21pages/dynamic_layouts.git + ref: 24cb88413fa5181d949ddacbb30a65d5c459e7d9 dev_dependencies: icons_launcher: ^2.0.4 From bdb1fc2ed7f9c94528860043f6966b8a9f877c21 Mon Sep 17 00:00:00 2001 From: 21pages Date: Wed, 27 Sep 2023 18:42:57 +0800 Subject: [PATCH 35/71] Give higher priority to AV1 over VP9 in the auto codec Signed-off-by: 21pages --- libs/scrap/src/common/codec.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/scrap/src/common/codec.rs b/libs/scrap/src/common/codec.rs index 2c3cbff6c..cbd433c39 100644 --- a/libs/scrap/src/common/codec.rs +++ b/libs/scrap/src/common/codec.rs @@ -195,6 +195,9 @@ impl Encoder { #[allow(unused_mut)] let mut auto_codec = CodecName::VP9; + if av1_useable { + auto_codec = CodecName::AV1; + } if vp8_useable && System::new_all().total_memory() <= 4 * 1024 * 1024 * 1024 { // 4 Gb auto_codec = CodecName::VP8 From 00d3d0f094ef7f79c72cdaf998d3ce97ea5e47a7 Mon Sep 17 00:00:00 2001 From: dignow Date: Wed, 27 Sep 2023 23:51:27 +0800 Subject: [PATCH 36/71] fix: cm await call 1. Cm may crash in wrong order. 2. The window may be at the left top. 3. The window may be wrong size. Signed-off-by: dignow --- flutter/lib/main.dart | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/flutter/lib/main.dart b/flutter/lib/main.dart index 79ef0616d..ef44a3bcc 100644 --- a/flutter/lib/main.dart +++ b/flutter/lib/main.dart @@ -234,19 +234,24 @@ void runConnectionManagerScreen(bool hide) async { listenUniLinks(handleByFlutter: false); } +bool _isCmReadyToShow = false; + showCmWindow({bool isStartup = false}) async { if (isStartup) { WindowOptions windowOptions = getHiddenTitleBarWindowOptions( size: kConnectionManagerWindowSizeClosedChat); - windowManager.waitUntilReadyToShow(windowOptions, () async { - bind.mainHideDocker(); - await windowManager.show(); - await Future.wait([windowManager.focus(), windowManager.setOpacity(1)]); - // ensure initial window size to be changed - await windowManager.setSizeAlignment( - kConnectionManagerWindowSizeClosedChat, Alignment.topRight); - }); - } else { + await windowManager.waitUntilReadyToShow(windowOptions, null); + bind.mainHideDocker(); + await Future.wait([ + windowManager.show(), + windowManager.focus(), + windowManager.setOpacity(1) + ]); + // ensure initial window size to be changed + await windowManager.setSizeAlignment( + kConnectionManagerWindowSizeClosedChat, Alignment.topRight); + _isCmReadyToShow = true; + } else if (_isCmReadyToShow) { if (await windowManager.getOpacity() != 1) { await windowManager.setOpacity(1); await windowManager.focus(); @@ -263,12 +268,12 @@ hideCmWindow({bool isStartup = false}) async { WindowOptions windowOptions = getHiddenTitleBarWindowOptions( size: kConnectionManagerWindowSizeClosedChat); windowManager.setOpacity(0); - windowManager.waitUntilReadyToShow(windowOptions, () async { - bind.mainHideDocker(); - await windowManager.minimize(); - await windowManager.hide(); - }); - } else { + await windowManager.waitUntilReadyToShow(windowOptions, null); + bind.mainHideDocker(); + await windowManager.minimize(); + await windowManager.hide(); + _isCmReadyToShow = true; + } else if (_isCmReadyToShow) { if (await windowManager.getOpacity() != 0) { await windowManager.setOpacity(0); bind.mainHideDocker(); From 20f1a85e697ecc6083de641bdf7c2b48d034a2fb Mon Sep 17 00:00:00 2001 From: Julien <6372605+fetzu@users.noreply.github.com> Date: Wed, 27 Sep 2023 23:02:49 +0200 Subject: [PATCH 37/71] Update fr.rs + Added French translation for new (and some old) strings. --- src/lang/fr.rs | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 4a28ede55..16022b6f5 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -317,7 +317,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Connection not allowed", "Connexion non autorisée"), ("Legacy mode", "Mode hérité"), ("Map mode", ""), - ("Translate mode", ""), + ("Translate mode", "Mode traduction"), ("Use permanent password", "Utiliser un mot de passe permanent"), ("Use both passwords", "Utiliser les mots de passe unique et permanent"), ("Set permanent password", "Définir le mot de passe permanent"), @@ -380,7 +380,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Enable LAN Discovery", "Activer la découverte sur réseau local"), ("Deny LAN Discovery", "Interdir la découverte sur réseau local"), ("Write a message", "Ecrire un message"), - ("Prompt", ""), + ("Prompt", "Annonce"), ("Please wait for confirmation of UAC...", "Veuillez attendre la confirmation de l'UAC..."), ("elevated_foreground_window_tip", "La fenêtre actuelle de l'appareil distant nécessite des privilèges plus élevés pour fonctionner, elle ne peut donc pas être atteinte par la souris et le clavier. Vous pouvez demander à l'utilisateur distant de réduire la fenêtre actuelle ou de cliquer sur le bouton d'élévation dans la fenêtre de gestion des connexions. Pour éviter ce problème, il est recommandé d'installer le logiciel sur l'appareil distant."), ("Disconnected", "Déconnecté"), @@ -397,8 +397,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("This PC", "Ce PC"), ("or", "ou"), ("Continue with", "Continuer avec"), - ("Elevate", ""), - ("Zoom cursor", ""), + ("Elevate", "Autoriser l'accès"), + ("Zoom cursor", "Augmenter la taille du curseur"), ("Accept sessions via password", "Accepter les sessions via mot de passe"), ("Accept sessions via click", "Accepter les sessions via clique de confirmation"), ("Accept sessions via both", "Accepter les sessions via mot de passe ou clique de confirmation"), @@ -541,21 +541,21 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Change Color", "Modifier la couleur"), ("Primary Color", "Couleur primaire"), ("HSV Color", "Couleur TSL"), - ("Installation Successful!", ""), - ("Installation failed!", ""), - ("Reverse mouse wheel", ""), - ("{} sessions", ""), - ("scam_title", ""), - ("scam_text1", ""), - ("scam_text2", ""), - ("Don't show again", ""), - ("I Agree", ""), - ("Decline", ""), - ("Timeout in minutes", ""), - ("auto_disconnect_option_tip", ""), - ("Connection failed due to inactivity", ""), - ("Check for software update on startup", ""), - ("upgrade_rustdesk_server_pro_to_{}_tip", ""), - ("pull_group_failed_tip", ""), + ("Installation Successful!", "Installation réussie !"), + ("Installation failed!", "Échec de l'installation !"), + ("Reverse mouse wheel", "Inverser le sens de la molette de la souris"), + ("{} sessions", "{} sessions"), + ("scam_title", "Vous êtes peut-être victime d'une ESCROQUERIE !"), + ("scam_text1", "Si vous êtes au téléphone avec quelqu'un QUE VOUS NE CONNAISSEZ PAS et en qui VOUS N'AVEZ PAS CONFIANCE et qui vous a demandé d'utiliser RustDesk et de démarrer le service, ne le faites pas et raccrochez immédiatement."), + ("scam_text2", "Il s'agit probablement d'un escroc qui tente de vous voler de l'argent ou d'autres informations personnelles."), + ("Don't show again", "Ne plus montrer"), + ("I Agree", "J'accepte"), + ("Decline", "Refuser"), + ("Timeout in minutes", "Délai d'expiration en minutes"), + ("auto_disconnect_option_tip", "Fermer automatiquement les sessions entrantes en cas d'inactivité de l'utilisateur"), + ("Connection failed due to inactivity", "Déconnecté automatiquement pour cause d'inactivité"), + ("Check for software update on startup", "Vérifier la disponibilité des mises à jour au démarrage"), + ("upgrade_rustdesk_server_pro_to_{}_tip", "Veuillez mettre à jour RustDesk Server Pro avec la version {} ou une version plus récente !"), + ("pull_group_failed_tip", "Échec de l'actualisation du groupe"), ].iter().cloned().collect(); } From 6028cfc1a3060480c77a0015b8674b1dd48ab755 Mon Sep 17 00:00:00 2001 From: 21pages Date: Thu, 28 Sep 2023 09:05:10 +0800 Subject: [PATCH 38/71] fix remote tab lable update, Get.find always return the first instance Signed-off-by: 21pages --- flutter/lib/common/widgets/peer_card.dart | 2 +- flutter/lib/desktop/widgets/tabbar_widget.dart | 7 ++----- flutter/lib/models/model.dart | 13 ------------- flutter/test/cm_test.dart | 2 +- src/flutter_ffi.rs | 5 ----- 5 files changed, 4 insertions(+), 25 deletions(-) diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart index def9cbc6f..ab2c8309a 100644 --- a/flutter/lib/common/widgets/peer_card.dart +++ b/flutter/lib/common/widgets/peer_card.dart @@ -1100,7 +1100,7 @@ class MyGroupPeerCard extends BasePeerCard { if (Platform.isWindows) { menuItems.add(_createShortCutAction(peer.id)); } - menuItems.add(MenuEntryDivider()); + // menuItems.add(MenuEntryDivider()); // menuItems.add(_renameAction(peer.id)); // if (await bind.mainPeerHasPassword(id: peer.id)) { // menuItems.add(_unrememberPasswordAction(peer.id)); diff --git a/flutter/lib/desktop/widgets/tabbar_widget.dart b/flutter/lib/desktop/widgets/tabbar_widget.dart index ce0dbe027..f95ee8923 100644 --- a/flutter/lib/desktop/widgets/tabbar_widget.dart +++ b/flutter/lib/desktop/widgets/tabbar_widget.dart @@ -269,11 +269,8 @@ class DesktopTab extends StatelessWidget { } static RxString tablabelGetter(String peerId) { - PeerStringOption.init(peerId, 'tabLabel', () { - final alias = bind.mainGetPeerOptionSync(id: peerId, key: 'alias'); - return getDesktopTabLabel(peerId, alias); - }); - return PeerStringOption.find(peerId, 'tabLabel'); + final alias = bind.mainGetPeerOptionSync(id: peerId, key: 'alias'); + return RxString(getDesktopTabLabel(peerId, alias)); } @override diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index 0f6cc5b9c..02e02a8ba 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -266,8 +266,6 @@ class FfiModel with ChangeNotifier { updateBlockInputState(evt, peerId); } else if (name == 'update_privacy_mode') { updatePrivacyMode(evt, sessionId, peerId); - } else if (name == 'alias') { - handleAliasChanged(evt); } else if (name == 'show_elevation') { final show = evt['show'].toString() == 'true'; parent.target?.serverModel.setShowElevation(show); @@ -353,17 +351,6 @@ class FfiModel with ChangeNotifier { platformFFI.setEventCallback(startEventListener(sessionId, peerId)); } - handleAliasChanged(Map evt) { - if (!isDesktop) return; - final String peerId = evt['id']; - final String alias = evt['alias']; - String label = getDesktopTabLabel(peerId, alias); - final rxTabLabel = PeerStringOption.find(evt['id'], 'tabLabel'); - if (rxTabLabel.value != label) { - rxTabLabel.value = label; - } - } - _updateCurDisplay(SessionID sessionId, Display newDisplay) { if (newDisplay != _display) { if (newDisplay.x != _display.x || newDisplay.y != _display.y) { diff --git a/flutter/test/cm_test.dart b/flutter/test/cm_test.dart index fca9d8cee..21b87b848 100644 --- a/flutter/test/cm_test.dart +++ b/flutter/test/cm_test.dart @@ -16,7 +16,7 @@ final testClients = [ Client(3, false, false, "UserDDDDDDDDDDDd", "441123123", true, false, false) ]; -/// flutter run -d {platform} -t lib/cm_test.dart to test cm +/// flutter run -d {platform} -t test/cm_test.dart to test cm void main(List args) async { isTest = true; WidgetsFlutterBinding.ensureInitialized(); diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index 9ebbc4b8a..63ced340d 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -823,11 +823,6 @@ pub fn main_set_peer_option_sync(id: String, key: String, value: String) -> Sync } pub fn main_set_peer_alias(id: String, alias: String) { - main_broadcast_message(&HashMap::from([ - ("name", "alias"), - ("id", &id), - ("alias", &alias), - ])); set_peer_option(id, "alias".to_owned(), alias) } From 5e444de031fdd9e5ff60c9ef49667b97a0af458e Mon Sep 17 00:00:00 2001 From: 21pages Date: Fri, 29 Sep 2023 08:42:06 +0800 Subject: [PATCH 39/71] show rdp menu only windows to windows Signed-off-by: 21pages --- flutter/lib/common/widgets/peer_card.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart index ab2c8309a..d9f599f37 100644 --- a/flutter/lib/common/widgets/peer_card.dart +++ b/flutter/lib/common/widgets/peer_card.dart @@ -868,7 +868,7 @@ class RecentPeerCard extends BasePeerCard { } // menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); - if (peer.platform == 'Windows') { + if (Platform.isWindows && peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); } if (Platform.isWindows) { @@ -922,7 +922,7 @@ class FavoritePeerCard extends BasePeerCard { } // menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); - if (peer.platform == 'Windows') { + if (Platform.isWindows && peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); } if (Platform.isWindows) { @@ -976,7 +976,7 @@ class DiscoveredPeerCard extends BasePeerCard { } // menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); - if (peer.platform == 'Windows') { + if (Platform.isWindows && peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); } menuItems.add(_wolAction(peer.id)); @@ -1026,7 +1026,7 @@ class AddressBookPeerCard extends BasePeerCard { } // menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); - if (peer.platform == 'Windows') { + if (Platform.isWindows && peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); } if (Platform.isWindows) { @@ -1094,7 +1094,7 @@ class MyGroupPeerCard extends BasePeerCard { } // menuItems.add(await _openNewConnInOptAction(peer.id)); // menuItems.add(await _forceAlwaysRelayAction(peer.id)); - if (peer.platform == 'Windows') { + if (Platform.isWindows && peer.platform == 'Windows') { menuItems.add(_rdpAction(context, peer.id)); } if (Platform.isWindows) { From 69062dca16acf7a38fabd1d461cccfaafdf6e522 Mon Sep 17 00:00:00 2001 From: dignow Date: Fri, 29 Sep 2023 21:42:49 +0800 Subject: [PATCH 40/71] fix, dialog button, reconnect cancel in a short time 1. Two `reconnect` is called. 2. The window cannot be closed. Signed-off-by: dignow --- flutter/lib/common.dart | 19 ++++++++++++++----- .../lib/desktop/pages/connection_page.dart | 1 - .../lib/desktop/pages/remote_tab_page.dart | 18 +++++++++++++++++- .../lib/desktop/widgets/tabbar_widget.dart | 2 -- flutter/lib/models/ab_model.dart | 1 - flutter/lib/models/model.dart | 1 - src/flutter.rs | 3 ++- 7 files changed, 33 insertions(+), 12 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 102b25bc9..2bd02fbf6 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -996,11 +996,20 @@ void msgBox(SessionID sessionId, String type, String title, String text, })); } if (reconnect != null && title == "Connection Error") { - buttons.insert( - 0, - dialogButton('Reconnect', isOutline: true, onPressed: () { - reconnect(dialogManager, sessionId, false); - })); + final enabled = true.obs; + final button = Obx( + () => dialogButton( + 'Reconnect', + isOutline: true, + onPressed: enabled.isTrue + ? () { + enabled.value = false; + reconnect(dialogManager, sessionId, false); + } + : null, + ), + ); + buttons.insert(0, button); } if (link.isNotEmpty) { buttons.insert(0, dialogButton('JumpLink', onPressed: jumplink)); diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart index 9cfa1defc..359746f4c 100644 --- a/flutter/lib/desktop/pages/connection_page.dart +++ b/flutter/lib/desktop/pages/connection_page.dart @@ -7,7 +7,6 @@ import 'dart:io'; import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hbb/consts.dart'; -import 'package:flutter_hbb/desktop/widgets/scroll_wrapper.dart'; import 'package:flutter_hbb/models/state_model.dart'; import 'package:get/get.dart'; import 'package:url_launcher/url_launcher_string.dart'; diff --git a/flutter/lib/desktop/pages/remote_tab_page.dart b/flutter/lib/desktop/pages/remote_tab_page.dart index 509ef0120..8f1079e0d 100644 --- a/flutter/lib/desktop/pages/remote_tab_page.dart +++ b/flutter/lib/desktop/pages/remote_tab_page.dart @@ -415,8 +415,24 @@ class _ConnectionTabPageState extends State { void onRemoveId(String id) async { if (tabController.state.value.tabs.isEmpty) { - await WindowController.fromWindowId(windowId()).close(); stateGlobal.setFullscreen(false, procWnd: false); + // Keep calling until the window status is hidden. + // + // Workaround for Windows: + // If you click other buttons and close in msgbox within a very short period of time, the close may fail. + // `await WindowController.fromWindowId(windowId()).close();`. + Future loopCloseWindow() async { + int c = 0; + final windowController = WindowController.fromWindowId(windowId()); + while (c < 100 && + tabController.state.value.tabs.isEmpty && + (!await windowController.isHidden())) { + await windowController.close(); + await Future.delayed(Duration(milliseconds: 50)); + c++; + } + } + loopCloseWindow(); } ConnectionTypeState.delete(id); _update_remote_count(); diff --git a/flutter/lib/desktop/widgets/tabbar_widget.dart b/flutter/lib/desktop/widgets/tabbar_widget.dart index f95ee8923..dc58c1b5d 100644 --- a/flutter/lib/desktop/widgets/tabbar_widget.dart +++ b/flutter/lib/desktop/widgets/tabbar_widget.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:convert'; import 'dart:io'; import 'dart:math'; import 'dart:ui' as ui; @@ -9,7 +8,6 @@ import 'package:desktop_multi_window/desktop_multi_window.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart' hide TabBarTheme; import 'package:flutter_hbb/common.dart'; -import 'package:flutter_hbb/common/shared_state.dart'; import 'package:flutter_hbb/consts.dart'; import 'package:flutter_hbb/main.dart'; import 'package:flutter_hbb/models/platform_model.dart'; diff --git a/flutter/lib/models/ab_model.dart b/flutter/lib/models/ab_model.dart index 03fb5897f..8d6bfda2c 100644 --- a/flutter/lib/models/ab_model.dart +++ b/flutter/lib/models/ab_model.dart @@ -6,7 +6,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_hbb/common/widgets/peers_view.dart'; import 'package:flutter_hbb/models/model.dart'; import 'package:flutter_hbb/models/peer_model.dart'; -import 'package:flutter_hbb/models/peer_tab_model.dart'; import 'package:flutter_hbb/models/platform_model.dart'; import 'package:get/get.dart'; import 'package:bot_toast/bot_toast.dart'; diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index 02e02a8ba..01fe767ad 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -8,7 +8,6 @@ import 'package:desktop_multi_window/desktop_multi_window.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_hbb/consts.dart'; -import 'package:flutter_hbb/desktop/widgets/tabbar_widget.dart'; import 'package:flutter_hbb/generated_bridge.dart'; import 'package:flutter_hbb/models/ab_model.dart'; import 'package:flutter_hbb/models/chat_model.dart'; diff --git a/src/flutter.rs b/src/flutter.rs index fe648ae2c..4440fe0c8 100644 --- a/src/flutter.rs +++ b/src/flutter.rs @@ -1078,7 +1078,8 @@ pub fn session_next_rgba(session_id: SessionID) { pub fn session_register_texture(_session_id: SessionID, _ptr: usize) { #[cfg(feature = "flutter_texture_render")] if let Some(session) = SESSIONS.write().unwrap().get_mut(&_session_id) { - return session.register_texture(_ptr); + session.register_texture(_ptr); + return; } } From 79a8715c8b5660caf381921b712cf83bb9f3bad8 Mon Sep 17 00:00:00 2001 From: dignow Date: Fri, 29 Sep 2023 22:53:58 +0800 Subject: [PATCH 41/71] fix, dialog button reconnect cancel, change the interval and try count Signed-off-by: dignow --- flutter/lib/desktop/pages/remote_tab_page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flutter/lib/desktop/pages/remote_tab_page.dart b/flutter/lib/desktop/pages/remote_tab_page.dart index 8f1079e0d..feec8de6a 100644 --- a/flutter/lib/desktop/pages/remote_tab_page.dart +++ b/flutter/lib/desktop/pages/remote_tab_page.dart @@ -424,11 +424,11 @@ class _ConnectionTabPageState extends State { Future loopCloseWindow() async { int c = 0; final windowController = WindowController.fromWindowId(windowId()); - while (c < 100 && + while (c < 20 && tabController.state.value.tabs.isEmpty && (!await windowController.isHidden())) { await windowController.close(); - await Future.delayed(Duration(milliseconds: 50)); + await Future.delayed(Duration(milliseconds: 100)); c++; } } From 56bed3f297ff2543928a10623bffd585cad460a1 Mon Sep 17 00:00:00 2001 From: dignow Date: Sat, 30 Sep 2023 11:14:31 +0800 Subject: [PATCH 42/71] Update flutter pub lock Signed-off-by: dignow --- flutter/pubspec.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flutter/pubspec.lock b/flutter/pubspec.lock index ada1dd512..559cb11ee 100644 --- a/flutter/pubspec.lock +++ b/flutter/pubspec.lock @@ -328,7 +328,7 @@ packages: description: path: "." ref: HEAD - resolved-ref: ba5de698dbe51a961d16ede8a94331d594873e62 + resolved-ref: ef03db52a20a7899da135d694c071fa3866c8fb1 url: "https://github.com/rustdesk-org/rustdesk_desktop_multi_window" source: git version: "0.1.0" From 661ce2951932b49be9cdaccef8969e8852c946e7 Mon Sep 17 00:00:00 2001 From: 21pages Date: Sat, 30 Sep 2023 11:22:18 +0800 Subject: [PATCH 43/71] fix request elevation menu not displayed when reconnect Signed-off-by: 21pages --- flutter/lib/models/model.dart | 1 + src/server/connection.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index 02e02a8ba..74d037870 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -1660,6 +1660,7 @@ class ElevationModel with ChangeNotifier { bool get showRequestMenu => _canElevate && !_running; onPeerInfo(PeerInfo pi) { _canElevate = pi.platform == kPeerPlatformWindows && pi.sasEnabled == false; + _running = false; } onPortableServiceRunning(Map evt) { diff --git a/src/server/connection.rs b/src/server/connection.rs index 2723b0834..a14fe07e0 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -2379,8 +2379,8 @@ impl Connection { )); if self.authorized { let p = &mut self.portable; - if running != p.last_running { - p.last_running = running; + if Some(running) != p.last_running { + p.last_running = Some(running); let mut misc = Misc::new(); misc.set_portable_service_running(running); let mut msg = Message::new(); @@ -2660,7 +2660,7 @@ pub enum FileAuditType { pub struct PortableState { pub last_uac: bool, pub last_foreground_window_elevated: bool, - pub last_running: bool, + pub last_running: Option, pub is_installed: bool, } From 3581e0beedc336bc06fa6a7982e1edfdad0919a5 Mon Sep 17 00:00:00 2001 From: dignow Date: Sat, 30 Sep 2023 14:21:11 +0800 Subject: [PATCH 44/71] Add comment Signed-off-by: dignow --- flutter/lib/common.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 2bd02fbf6..858756ed2 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -996,6 +996,7 @@ void msgBox(SessionID sessionId, String type, String title, String text, })); } if (reconnect != null && title == "Connection Error") { + // `enabled` is used to disable the dialog button once the button is clicked. final enabled = true.obs; final button = Obx( () => dialogButton( @@ -1003,6 +1004,7 @@ void msgBox(SessionID sessionId, String type, String title, String text, isOutline: true, onPressed: enabled.isTrue ? () { + // Disable the button enabled.value = false; reconnect(dialogManager, sessionId, false); } From 7fcb3d70bb987e4b92e1d2ca2c226e500be8cab8 Mon Sep 17 00:00:00 2001 From: dignow Date: Sat, 30 Sep 2023 22:07:14 +0800 Subject: [PATCH 45/71] fix, reconnect deadlock, introduce connection round control Signed-off-by: dignow --- src/client/io_loop.rs | 21 ++++++-- src/flutter.rs | 3 +- src/plugin/native_handlers/session.rs | 9 ++-- src/ui_session_interface.rs | 73 +++++++++++++++++++++++++-- 4 files changed, 94 insertions(+), 12 deletions(-) diff --git a/src/client/io_loop.rs b/src/client/io_loop.rs index 254f72583..3e9465368 100644 --- a/src/client/io_loop.rs +++ b/src/client/io_loop.rs @@ -106,7 +106,7 @@ impl Remote { } } - pub async fn io_loop(&mut self, key: &str, token: &str) { + pub async fn io_loop(&mut self, key: &str, token: &str, round: u32) { let mut last_recv_time = Instant::now(); let mut received = false; let conn_type = if self.handler.is_file_transfer() { @@ -125,6 +125,11 @@ impl Remote { .await { Ok((mut peer, direct, pk)) => { + self.handler + .connection_round_state + .lock() + .unwrap() + .set_connected(); self.handler.set_connection_type(peer.is_secured(), direct); // flutter -> connection_ready self.handler.update_direct(Some(direct)); if conn_type == ConnType::DEFAULT_CONN { @@ -245,11 +250,21 @@ impl Remote { self.handler.on_establish_connection_error(err.to_string()); } } + // set_disconnected_ok is used to check if new connection round is started. + let set_disconnected_ok = self + .handler + .connection_round_state + .lock() + .unwrap() + .set_disconnected(round); + #[cfg(not(any(target_os = "android", target_os = "ios")))] - Client::try_stop_clipboard(&self.handler.session_id); + if set_disconnected_ok { + Client::try_stop_clipboard(&self.handler.session_id); + } #[cfg(windows)] - { + if set_disconnected_ok { let conn_id = self.client_conn_id; ContextSend::proc(|context: &mut CliprdrClientContext| -> u32 { empty_clipboard(context, conn_id); diff --git a/src/flutter.rs b/src/flutter.rs index 4440fe0c8..0f57e0a73 100644 --- a/src/flutter.rs +++ b/src/flutter.rs @@ -805,7 +805,8 @@ pub fn session_start_( if !is_pre_added { let session = session.clone(); std::thread::spawn(move || { - io_loop(session); + let round = session.connection_round_state.lock().unwrap().new_round(); + io_loop(session, round); }); } Ok(()) diff --git a/src/plugin/native_handlers/session.rs b/src/plugin/native_handlers/session.rs index fda07cd17..52edd3300 100644 --- a/src/plugin/native_handlers/session.rs +++ b/src/plugin/native_handlers/session.rs @@ -8,8 +8,10 @@ use std::{ use flutter_rust_bridge::StreamSink; use crate::{ - define_method_prefix, flutter::FlutterHandler, flutter_ffi::EventToUI, - plugin::MSG_TO_UI_TYPE_PLUGIN_EVENT, ui_session_interface::Session, + define_method_prefix, + flutter::FlutterHandler, + flutter_ffi::EventToUI, + ui_session_interface::{ConnectionState, Session}, }; const MSG_TO_UI_TYPE_SESSION_CREATED: &str = "session_created"; @@ -61,7 +63,8 @@ impl PluginNativeHandler for PluginNativeSessionHandler { let sessions = SESSION_HANDLER.sessions.read().unwrap(); for session in sessions.iter() { if session.id == id { - crate::ui_session_interface::io_loop(session.clone()); + let round = session.connection_round_state.lock().unwrap().new_round(); + crate::ui_session_interface::io_loop(session.clone(), round); } } } diff --git a/src/ui_session_interface.rs b/src/ui_session_interface.rs index 5d3ecb7a6..9a07782b9 100644 --- a/src/ui_session_interface.rs +++ b/src/ui_session_interface.rs @@ -62,6 +62,7 @@ pub struct Session { pub server_file_transfer_enabled: Arc>, pub server_clipboard_enabled: Arc>, pub last_change_display: Arc>, + pub connection_round_state: Arc>, } #[derive(Clone)] @@ -79,6 +80,56 @@ pub struct ChangeDisplayRecord { height: i32, } +enum ConnectionState { + Connecting, + Connected, + Disconnected, +} + +/// ConnectionRoundState is used to control the reconnecting logic. +pub struct ConnectionRoundState { + round: u32, + state: ConnectionState, +} + +impl ConnectionRoundState { + pub fn new_round(&mut self) -> u32 { + self.round += 1; + self.state = ConnectionState::Connecting; + self.round + } + + pub fn set_connected(&mut self) { + self.state = ConnectionState::Connected; + } + + pub fn is_round_gt(&self, round: u32) -> bool { + if round == u32::MAX && self.round == 0 { + true + } else { + round < self.round + } + } + + pub fn set_disconnected(&mut self, round: u32) -> bool { + if self.is_round_gt(round) { + false + } else { + self.state = ConnectionState::Disconnected; + true + } + } +} + +impl Default for ConnectionRoundState { + fn default() -> Self { + Self { + round: 0, + state: ConnectionState::Connecting, + } + } +} + impl Default for ChangeDisplayRecord { fn default() -> Self { Self { @@ -833,16 +884,28 @@ impl Session { } pub fn reconnect(&self, force_relay: bool) { - self.send(Data::Close); + // 1. If current session is connecting, do not reconnect. + // 2. If the connection is established, send `Data::Close`. + // 3. If the connection is disconnected, do nothing. + let mut connection_round_state_lock = self.connection_round_state.lock().unwrap(); + match connection_round_state_lock.state { + ConnectionState::Connecting => return, + ConnectionState::Connected => self.send(Data::Close), + ConnectionState::Disconnected => {} + } + let round = connection_round_state_lock.new_round(); + drop(connection_round_state_lock); + let cloned = self.clone(); // override only if true if true == force_relay { cloned.lc.write().unwrap().force_relay = true; } let mut lock = self.thread.lock().unwrap(); - lock.take().map(|t| t.join()); + // No need to join the previous thread, because it will exit automatically. + // And the previous thread will not change important states. *lock = Some(std::thread::spawn(move || { - io_loop(cloned); + io_loop(cloned, round); })); } @@ -1283,7 +1346,7 @@ impl Session { } #[tokio::main(flavor = "current_thread")] -pub async fn io_loop(handler: Session) { +pub async fn io_loop(handler: Session, round: u32) { // It is ok to call this function multiple times. #[cfg(target_os = "windows")] if !handler.is_file_transfer() && !handler.is_port_forward() { @@ -1402,7 +1465,7 @@ pub async fn io_loop(handler: Session) { frame_count, decode_fps, ); - remote.io_loop(&key, &token).await; + remote.io_loop(&key, &token, round).await; remote.sync_jobs_status_to_local().await; } From 0bd86a8211c7dac983d111aec7494187e4b4c8f7 Mon Sep 17 00:00:00 2001 From: dignow Date: Sat, 30 Sep 2023 22:09:32 +0800 Subject: [PATCH 46/71] remove warn Signed-off-by: dignow --- src/client/io_loop.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/io_loop.rs b/src/client/io_loop.rs index 3e9465368..6b170096e 100644 --- a/src/client/io_loop.rs +++ b/src/client/io_loop.rs @@ -251,7 +251,7 @@ impl Remote { } } // set_disconnected_ok is used to check if new connection round is started. - let set_disconnected_ok = self + let _set_disconnected_ok = self .handler .connection_round_state .lock() @@ -259,12 +259,12 @@ impl Remote { .set_disconnected(round); #[cfg(not(any(target_os = "android", target_os = "ios")))] - if set_disconnected_ok { + if _set_disconnected_ok { Client::try_stop_clipboard(&self.handler.session_id); } #[cfg(windows)] - if set_disconnected_ok { + if _set_disconnected_ok { let conn_id = self.client_conn_id; ContextSend::proc(|context: &mut CliprdrClientContext| -> u32 { empty_clipboard(context, conn_id); From d8e51c6b14cedb9bc1767c22ae6092bfe3aa5e7c Mon Sep 17 00:00:00 2001 From: 21pages Date: Fri, 29 Sep 2023 15:09:58 +0800 Subject: [PATCH 47/71] render cm side page after window size change, calculate real window width Signed-off-by: 21pages --- flutter/lib/desktop/pages/server_page.dart | 72 +++++++++++++--------- flutter/lib/models/chat_model.dart | 4 ++ 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/flutter/lib/desktop/pages/server_page.dart b/flutter/lib/desktop/pages/server_page.dart index 2ef04b244..89a43adf6 100644 --- a/flutter/lib/desktop/pages/server_page.dart +++ b/flutter/lib/desktop/pages/server_page.dart @@ -175,34 +175,47 @@ class ConnectionManagerState extends State { ], ); }, - pageViewBuilder: (pageView) => Row( - children: [ - Consumer( - builder: (_, model, child) => model.isShowCMSidePage - ? Expanded( - child: buildRemoteBlock( - child: Container( - decoration: BoxDecoration( - border: Border( - right: BorderSide( - color: Theme.of(context) - .dividerColor))), - child: buildSidePage()), - ), - flex: (kConnectionManagerWindowSizeOpenChat.width - - kConnectionManagerWindowSizeClosedChat - .width) - .toInt(), - ) - : Offstage(), - ), - Expanded( - child: pageView, - flex: kConnectionManagerWindowSizeClosedChat.width - .toInt() - - 4 // prevent stretch of the page view when chat is open, - ), - ], + pageViewBuilder: (pageView) => LayoutBuilder( + builder: (context, constrains) { + var borderWidth = 0.0; + if (constrains.maxWidth > + kConnectionManagerWindowSizeClosedChat.width) { + borderWidth = kConnectionManagerWindowSizeOpenChat.width - + constrains.maxWidth; + } else { + borderWidth = kConnectionManagerWindowSizeClosedChat.width - + constrains.maxWidth; + } + if (borderWidth < 0 || borderWidth > 50) { + borderWidth = 0; + } + final realClosedWidth = + kConnectionManagerWindowSizeClosedChat.width - + borderWidth; + final realChatPageWidth = + constrains.maxWidth - realClosedWidth; + return Row(children: [ + if (constrains.maxWidth > + kConnectionManagerWindowSizeClosedChat.width) + Consumer( + builder: (_, model, child) => SizedBox( + width: realChatPageWidth, + child: buildRemoteBlock( + child: Container( + decoration: BoxDecoration( + border: Border( + right: BorderSide( + color: Theme.of(context) + .dividerColor))), + child: buildSidePage()), + ), + )), + SizedBox( + width: realClosedWidth, + child: + SizedBox(width: realClosedWidth, child: pageView)), + ]); + }, ), ), ); @@ -966,8 +979,7 @@ class __FileTransferLogPageState extends State<_FileTransferLogPage> { return PreferredSize( preferredSize: const Size(200, double.infinity), child: Container( - margin: const EdgeInsets.only(top: 16.0, bottom: 16.0, right: 16.0), - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.all(12.0), child: Obx( () { final jobTable = gFFI.cmFileModel.currentJobTable; diff --git a/flutter/lib/models/chat_model.dart b/flutter/lib/models/chat_model.dart index ed216e500..77eeb3a7e 100644 --- a/flutter/lib/models/chat_model.dart +++ b/flutter/lib/models/chat_model.dart @@ -285,7 +285,10 @@ class ChatModel with ChangeNotifier { await toggleCMSidePage(); } + var _togglingCMSidePage = false; // protect order for await toggleCMSidePage() async { + if (_togglingCMSidePage) return false; + _togglingCMSidePage = true; if (_isShowCMSidePage) { _isShowCMSidePage = !_isShowCMSidePage; notifyListeners(); @@ -300,6 +303,7 @@ class ChatModel with ChangeNotifier { _isShowCMSidePage = !_isShowCMSidePage; notifyListeners(); } + _togglingCMSidePage = false; } changeCurrentKey(MessageKey key) { From 17a56bbf481234301b6d6ccacf8c9be9f98d0e26 Mon Sep 17 00:00:00 2001 From: 21pages Date: Sat, 30 Sep 2023 19:47:59 +0800 Subject: [PATCH 48/71] elevation: keyboard permission required and remove foreground filter Signed-off-by: 21pages --- flutter/lib/common/widgets/dialog.dart | 9 +++++++- flutter/lib/common/widgets/toolbar.dart | 8 ++++--- src/client/io_loop.rs | 11 +++++---- src/lang/ar.rs | 1 + src/lang/ca.rs | 1 + src/lang/cn.rs | 1 + src/lang/cs.rs | 1 + src/lang/da.rs | 1 + src/lang/de.rs | 1 + src/lang/el.rs | 1 + src/lang/eo.rs | 1 + src/lang/es.rs | 1 + src/lang/fa.rs | 1 + src/lang/fr.rs | 1 + src/lang/hu.rs | 1 + src/lang/id.rs | 1 + src/lang/it.rs | 1 + src/lang/ja.rs | 1 + src/lang/ko.rs | 1 + src/lang/kz.rs | 1 + src/lang/lt.rs | 1 + src/lang/lv.rs | 4 +--- src/lang/nl.rs | 1 + src/lang/pl.rs | 1 + src/lang/pt_PT.rs | 1 + src/lang/ptbr.rs | 1 + src/lang/ro.rs | 1 + src/lang/ru.rs | 1 + src/lang/sk.rs | 1 + src/lang/sl.rs | 1 + src/lang/sq.rs | 1 + src/lang/sr.rs | 1 + src/lang/sv.rs | 1 + src/lang/template.rs | 1 + src/lang/th.rs | 1 + src/lang/tr.rs | 1 + src/lang/tw.rs | 1 + src/lang/ua.rs | 1 + src/lang/vn.rs | 1 + src/platform/windows.rs | 30 +------------------------ src/server/connection.rs | 17 +++++++++----- 41 files changed, 69 insertions(+), 45 deletions(-) diff --git a/flutter/lib/common/widgets/dialog.dart b/flutter/lib/common/widgets/dialog.dart index 0cb2741be..2fe5d7637 100644 --- a/flutter/lib/common/widgets/dialog.dart +++ b/flutter/lib/common/widgets/dialog.dart @@ -711,6 +711,13 @@ void showWaitUacDialog( (setState, close, context) => CustomAlertDialog( title: null, content: msgboxContent(type, 'Wait', 'wait_accept_uac_tip'), + actions: [ + dialogButton( + 'OK', + icon: Icon(Icons.done_rounded), + onPressed: close, + ), + ], )); } @@ -931,7 +938,7 @@ void showElevationError(SessionID sessionId, String type, String title, dialogButton('Cancel', onPressed: () { close(); }, isOutline: true), - dialogButton('Retry', onPressed: submit), + if (text != 'No permission') dialogButton('Retry', onPressed: submit), ], onSubmit: submit, onCancel: close, diff --git a/flutter/lib/common/widgets/toolbar.dart b/flutter/lib/common/widgets/toolbar.dart index 4cf6fd3ea..0e8ed6b3d 100644 --- a/flutter/lib/common/widgets/toolbar.dart +++ b/flutter/lib/common/widgets/toolbar.dart @@ -49,7 +49,8 @@ class TToggleMenu { handleOsPasswordEditIcon( SessionID sessionId, OverlayDialogManager dialogManager) { isEditOsPassword = true; - showSetOSPassword(sessionId, false, dialogManager, null, () => isEditOsPassword = false); + showSetOSPassword( + sessionId, false, dialogManager, null, () => isEditOsPassword = false); } handleOsPasswordAction( @@ -62,7 +63,8 @@ handleOsPasswordAction( await bind.sessionGetOption(sessionId: sessionId, arg: 'os-password') ?? ''; if (password.isEmpty) { - showSetOSPassword(sessionId, true, dialogManager, password, () => isEditOsPassword = false); + showSetOSPassword(sessionId, true, dialogManager, password, + () => isEditOsPassword = false); } else { bind.sessionInputOsPassword(sessionId: sessionId, value: password); } @@ -76,7 +78,7 @@ List toolbarControls(BuildContext context, String id, FFI ffi) { List v = []; // elevation - if (ffi.elevationModel.showRequestMenu) { + if (perms['keyboard'] != false && ffi.elevationModel.showRequestMenu) { v.add( TTextMenu( child: Text(translate('Request Elevation')), diff --git a/src/client/io_loop.rs b/src/client/io_loop.rs index 254f72583..0d579e3da 100644 --- a/src/client/io_loop.rs +++ b/src/client/io_loop.rs @@ -1303,9 +1303,10 @@ impl Remote { } } Some(misc::Union::Uac(uac)) => { + let keyboard = self.handler.server_keyboard_enabled.read().unwrap().clone(); #[cfg(feature = "flutter")] { - if uac { + if uac && keyboard { self.handler.msgbox( "on-uac", "Prompt", @@ -1324,7 +1325,7 @@ impl Remote { let title = "Prompt"; let text = "Please wait for confirmation of UAC..."; let link = ""; - if uac { + if uac && keyboard { self.handler.msgbox(msgtype, title, text, link); } else { self.handler.cancel_msgbox(&format!( @@ -1335,9 +1336,10 @@ impl Remote { } } Some(misc::Union::ForegroundWindowElevated(elevated)) => { + let keyboard = self.handler.server_keyboard_enabled.read().unwrap().clone(); #[cfg(feature = "flutter")] { - if elevated { + if elevated && keyboard { self.handler.msgbox( "on-foreground-elevated", "Prompt", @@ -1356,7 +1358,7 @@ impl Remote { let title = "Prompt"; let text = "elevated_foreground_window_tip"; let link = ""; - if elevated { + if elevated && keyboard { self.handler.msgbox(msgtype, title, text, link); } else { self.handler.cancel_msgbox(&format!( @@ -1370,6 +1372,7 @@ impl Remote { if err.is_empty() { self.handler.msgbox("wait-uac", "", "", ""); } else { + self.handler.cancel_msgbox("wait-uac"); self.handler .msgbox("elevation-error", "Elevation Error", &err, ""); } diff --git a/src/lang/ar.rs b/src/lang/ar.rs index 3500e2916..f4bbff8db 100644 --- a/src/lang/ar.rs +++ b/src/lang/ar.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 1fd7dff11..3a093484d 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 00cdc9390..da2c61bb2 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "启动时检查软件更新"), ("upgrade_rustdesk_server_pro_to_{}_tip", "请升级专业版服务器到{}或更高版本!"), ("pull_group_failed_tip", "获取组信息失败"), + ("No permission", "没有权限"), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index cd7f3a306..87e9d5612 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index 7d1321890..2c6960eaa 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index 4d2d8b466..8df8acb95 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "Beim Start auf Softwareaktualisierung prüfen"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Bitte aktualisieren Sie RustDesk Server Pro auf die Version {} oder neuer!"), ("pull_group_failed_tip", "Aktualisierung der Gruppe fehlgeschlagen"), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index 76327d0ea..a371721c3 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 9b73932f2..95b95c941 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index 4de8a142e..a1faef630 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "Comprobar actualización al iniciar"), ("upgrade_rustdesk_server_pro_to_{}_tip", "¡Por favor, actualiza RustDesk Server Pro a la versión {} o superior"), ("pull_group_failed_tip", "No se ha podido refrescar el grupo"), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index 25a526377..2ea2e3098 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 16022b6f5..1c0b92817 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "Vérifier la disponibilité des mises à jour au démarrage"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Veuillez mettre à jour RustDesk Server Pro avec la version {} ou une version plus récente !"), ("pull_group_failed_tip", "Échec de l'actualisation du groupe"), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index bb3388341..afe29cef8 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index 967ff2bcd..19945a3b9 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "Periksa pembaruan aplikasi saat sistem dinyalakan."), ("upgrade_rustdesk_server_pro_to_{}_tip", "Silahkan perbarui RustDesk Server Pro ke versi {} atau yang lebih baru!"), ("pull_group_failed_tip", "Gagal memperbarui grup"), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index e0a944036..d1dc5e660 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "All'avvio verifica presenza aggiornamenti programma"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Aggiorna RustDesk Server Pro alla versione {} o successiva!"), ("pull_group_failed_tip", "Impossibile aggiornare il gruppo"), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 04b00dbfe..435ea3ff9 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index 4d8677c81..a74ebca51 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 2eab96f76..5eeb06b18 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lt.rs b/src/lang/lt.rs index c2dece955..5342596b1 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lv.rs b/src/lang/lv.rs index b1abd922b..167452db4 100644 --- a/src/lang/lv.rs +++ b/src/lang/lv.rs @@ -57,7 +57,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("ID Server", "ID serveris"), ("Relay Server", "Releja serveris"), ("API Server", "API serveris"), - ("Key", "Atslēga"), ("invalid_http", "jāsākas ar http:// vai https://"), ("Invalid IP", "Nederīga IP"), ("Invalid format", "Nederīgs formāts"), @@ -297,7 +296,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("This file exists, skip or overwrite this file?", "Šis fails pastāv, izlaist vai pārrakstīt šo failu?"), ("Quit", "Iziet"), ("doc_mac_permission", "https://rustdesk.com/docs/en/manual/mac/#enable-permissions"), - ("doc_fix_wayland", "https://rustdesk.com/docs/en/manual/linux/#x11-required"), ("Help", "Palīdzība"), ("Failed", "Neizdevās"), ("Succeeded", "Izdevās"), @@ -481,7 +479,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Me", "Es"), ("identical_file_tip", "Šis fails ir identisks sesijas failam."), ("show_monitors_tip", "Rādīt monitorus rīkjoslā"), - ("enter_rustdesk_passwd_tip", "Ievadiet RustDesk paroli"), ("View Mode", "Skatīšanas režīms"), ("login_linux_tip", "Jums ir jāpiesakās attālajā Linux kontā, lai iespējotu X darbvirsmas sesiju"), ("verify_rustdesk_password_tip", "Pārbaudīt RustDesk paroli"), @@ -560,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "Startējot pārbaudīt, vai nav programmatūras atjauninājumu"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Lūdzu, jauniniet RustDesk Server Pro uz versiju {} vai jaunāku!"), ("pull_group_failed_tip", "Neizdevās atsvaidzināt grupu"), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index b879a896c..dfd1b121f 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 71813688c..0f273a121 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "Sprawdź aktualizacje przy starcie programu"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Proszę zaktualizować RustDesk Server Pro do wersji {} lub nowszej!"), ("pull_group_failed_tip", "Błąd odświeżania grup"), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index f540bc76d..a42baf7d7 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index 719886a18..aea4c4134 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index b347278fc..5c05f88c0 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index 3556bdbd0..da3ab1704 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "Проверять обновления программы при запуске"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Обновите RustDesk Server Pro до версии {} или новее!"), ("pull_group_failed_tip", "Невозможно обновить группу"), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index 05c3160fd..aaa8a1d1d 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index c22b2ecd1..da32b5805 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index d0875114d..1e1ce6427 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index 13819f37e..527242a14 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index e54b7c7b6..5f6d15dfc 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index e442c826e..282370744 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index 2629540d2..edb5f857d 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index 20a1ce942..89db0f029 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index 0074e8afb..002bf2473 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index facada5f1..182caec7f 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index 9eec26b0c..fd86d9b74 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -557,5 +557,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), + ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/platform/windows.rs b/src/platform/windows.rs index e4b3c431d..a74cbf896 100644 --- a/src/platform/windows.rs +++ b/src/platform/windows.rs @@ -1587,29 +1587,6 @@ pub fn is_elevated(process_id: Option) -> ResultType { } } -#[inline] -fn filter_foreground_window(process_id: DWORD) -> ResultType { - if let Ok(output) = std::process::Command::new("tasklist") - .args(vec![ - "/SVC", - "/NH", - "/FI", - &format!("PID eq {}", process_id), - ]) - .creation_flags(CREATE_NO_WINDOW) - .output() - { - let s = String::from_utf8_lossy(&output.stdout) - .to_string() - .to_lowercase(); - Ok(["Taskmgr", "mmc", "regedit"] - .iter() - .any(|name| s.contains(&name.to_string().to_lowercase()))) - } else { - bail!("run tasklist failed"); - } -} - pub fn is_foreground_window_elevated() -> ResultType { unsafe { let mut process_id: DWORD = 0; @@ -1617,12 +1594,7 @@ pub fn is_foreground_window_elevated() -> ResultType { if process_id == 0 { bail!("Failed to get processId, errno {}", GetLastError()) } - let elevated = is_elevated(Some(process_id))?; - if elevated { - filter_foreground_window(process_id) - } else { - Ok(false) - } + is_elevated(Some(process_id)) } } diff --git a/src/server/connection.rs b/src/server/connection.rs index a14fe07e0..35538a85a 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -2047,12 +2047,18 @@ impl Connection { #[cfg(windows)] async fn handle_elevation_request(&mut self, para: portable_client::StartPara) { - let mut err = "No need to elevate".to_string(); - if !crate::platform::is_installed() && !portable_client::running() { - err = portable_client::start_portable_service(para) - .err() - .map_or("".to_string(), |e| e.to_string()); + let mut err; + if !self.keyboard { + err = "No permission".to_string(); + } else { + err = "No need to elevate".to_string(); + if !crate::platform::is_installed() && !portable_client::running() { + err = portable_client::start_portable_service(para) + .err() + .map_or("".to_string(), |e| e.to_string()); + } } + let mut misc = Misc::new(); misc.set_elevation_response(err); let mut msg = Message::new(); @@ -2369,6 +2375,7 @@ impl Connection { if self.portable.is_installed || self.file_transfer.is_some() || self.port_forward_socket.is_some() + || !self.keyboard { return; } From b88fafe5ff5594aa576f3f3559d7ecf9cb8e840a Mon Sep 17 00:00:00 2001 From: fufesou Date: Sun, 1 Oct 2023 12:16:06 +0800 Subject: [PATCH 49/71] refact, remove cursor if mobile -- mobile Signed-off-by: fufesou --- flutter/lib/common/widgets/peer_card.dart | 20 ++++++++++---------- flutter/lib/mobile/pages/remote_page.dart | 8 ++++++-- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/flutter/lib/common/widgets/peer_card.dart b/flutter/lib/common/widgets/peer_card.dart index d9f599f37..a843c3d41 100644 --- a/flutter/lib/common/widgets/peer_card.dart +++ b/flutter/lib/common/widgets/peer_card.dart @@ -863,12 +863,12 @@ class RecentPeerCard extends BasePeerCard { final List favs = (await bind.mainGetFav()).toList(); - if (isDesktop && peer.platform != 'Android') { + if (isDesktop && peer.platform != kPeerPlatformAndroid) { menuItems.add(_tcpTunnelingAction(context, peer.id)); } // menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); - if (Platform.isWindows && peer.platform == 'Windows') { + if (Platform.isWindows && peer.platform == kPeerPlatformWindows) { menuItems.add(_rdpAction(context, peer.id)); } if (Platform.isWindows) { @@ -917,12 +917,12 @@ class FavoritePeerCard extends BasePeerCard { _connectAction(context, peer), _transferFileAction(context, peer.id), ]; - if (isDesktop && peer.platform != 'Android') { + if (isDesktop && peer.platform != kPeerPlatformAndroid) { menuItems.add(_tcpTunnelingAction(context, peer.id)); } // menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); - if (Platform.isWindows && peer.platform == 'Windows') { + if (Platform.isWindows && peer.platform == kPeerPlatformWindows) { menuItems.add(_rdpAction(context, peer.id)); } if (Platform.isWindows) { @@ -971,12 +971,12 @@ class DiscoveredPeerCard extends BasePeerCard { final List favs = (await bind.mainGetFav()).toList(); - if (isDesktop && peer.platform != 'Android') { + if (isDesktop && peer.platform != kPeerPlatformAndroid) { menuItems.add(_tcpTunnelingAction(context, peer.id)); } // menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); - if (Platform.isWindows && peer.platform == 'Windows') { + if (Platform.isWindows && peer.platform == kPeerPlatformWindows) { menuItems.add(_rdpAction(context, peer.id)); } menuItems.add(_wolAction(peer.id)); @@ -1021,12 +1021,12 @@ class AddressBookPeerCard extends BasePeerCard { _connectAction(context, peer), _transferFileAction(context, peer.id), ]; - if (isDesktop && peer.platform != 'Android') { + if (isDesktop && peer.platform != kPeerPlatformAndroid) { menuItems.add(_tcpTunnelingAction(context, peer.id)); } // menuItems.add(await _openNewConnInOptAction(peer.id)); menuItems.add(await _forceAlwaysRelayAction(peer.id)); - if (Platform.isWindows && peer.platform == 'Windows') { + if (Platform.isWindows && peer.platform == kPeerPlatformWindows) { menuItems.add(_rdpAction(context, peer.id)); } if (Platform.isWindows) { @@ -1089,12 +1089,12 @@ class MyGroupPeerCard extends BasePeerCard { _connectAction(context, peer), _transferFileAction(context, peer.id), ]; - if (isDesktop && peer.platform != 'Android') { + if (isDesktop && peer.platform != kPeerPlatformAndroid) { menuItems.add(_tcpTunnelingAction(context, peer.id)); } // menuItems.add(await _openNewConnInOptAction(peer.id)); // menuItems.add(await _forceAlwaysRelayAction(peer.id)); - if (Platform.isWindows && peer.platform == 'Windows') { + if (Platform.isWindows && peer.platform == kPeerPlatformWindows) { menuItems.add(_rdpAction(context, peer.id)); } if (Platform.isWindows) { diff --git a/flutter/lib/mobile/pages/remote_page.dart b/flutter/lib/mobile/pages/remote_page.dart index 49601ece3..f638fb2e8 100644 --- a/flutter/lib/mobile/pages/remote_page.dart +++ b/flutter/lib/mobile/pages/remote_page.dart @@ -421,6 +421,10 @@ class _RemotePageState extends State { ); } + // to-do: Check if peer is ios. + bool get isPeerMobile => kPeerPlatformAndroid == gFFI.ffiModel.pi.platform; + bool get showCursorPaint => !isPeerMobile && !gFFI.canvasModel.cursorEmbedded; + Widget getBodyForMobile() { final keyboardIsVisible = keyboardVisibilityController.isVisible; return Container( @@ -453,7 +457,7 @@ class _RemotePageState extends State { ), ), ]; - if (!gFFI.canvasModel.cursorEmbedded) { + if (showCursorPaint) { paints.add(CursorPaint()); } return paints; @@ -462,7 +466,7 @@ class _RemotePageState extends State { Widget getBodyForDesktopWithListener(bool keyboard) { var paints = [ImagePaint()]; - if (!gFFI.canvasModel.cursorEmbedded) { + if (showCursorPaint) { final cursor = bind.sessionGetToggleOptionSync( sessionId: sessionId, arg: 'show-remote-cursor'); if (keyboard || cursor) { From 6ead1f4bd99a5028ac10e52703b9ceae967113e1 Mon Sep 17 00:00:00 2001 From: 21pages Date: Sun, 1 Oct 2023 13:02:37 +0800 Subject: [PATCH 50/71] remove useless translations Signed-off-by: 21pages --- src/lang/ar.rs | 1 - src/lang/ca.rs | 1 - src/lang/cn.rs | 1 - src/lang/cs.rs | 1 - src/lang/da.rs | 1 - src/lang/de.rs | 1 - src/lang/el.rs | 1 - src/lang/eo.rs | 1 - src/lang/es.rs | 1 - src/lang/fa.rs | 1 - src/lang/fr.rs | 1 - src/lang/hu.rs | 1 - src/lang/id.rs | 1 - src/lang/it.rs | 1 - src/lang/ja.rs | 1 - src/lang/ko.rs | 1 - src/lang/kz.rs | 1 - src/lang/lt.rs | 1 - src/lang/lv.rs | 4 +++- src/lang/nl.rs | 1 - src/lang/pl.rs | 1 - src/lang/pt_PT.rs | 1 - src/lang/ptbr.rs | 1 - src/lang/ro.rs | 1 - src/lang/ru.rs | 1 - src/lang/sk.rs | 1 - src/lang/sl.rs | 1 - src/lang/sq.rs | 1 - src/lang/sr.rs | 1 - src/lang/sv.rs | 1 - src/lang/template.rs | 1 - src/lang/th.rs | 1 - src/lang/tr.rs | 1 - src/lang/tw.rs | 1 - src/lang/ua.rs | 1 - src/lang/vn.rs | 1 - 36 files changed, 3 insertions(+), 36 deletions(-) diff --git a/src/lang/ar.rs b/src/lang/ar.rs index f4bbff8db..3500e2916 100644 --- a/src/lang/ar.rs +++ b/src/lang/ar.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ca.rs b/src/lang/ca.rs index 3a093484d..1fd7dff11 100644 --- a/src/lang/ca.rs +++ b/src/lang/ca.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/cn.rs b/src/lang/cn.rs index da2c61bb2..00cdc9390 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "启动时检查软件更新"), ("upgrade_rustdesk_server_pro_to_{}_tip", "请升级专业版服务器到{}或更高版本!"), ("pull_group_failed_tip", "获取组信息失败"), - ("No permission", "没有权限"), ].iter().cloned().collect(); } diff --git a/src/lang/cs.rs b/src/lang/cs.rs index 87e9d5612..cd7f3a306 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/da.rs b/src/lang/da.rs index 2c6960eaa..7d1321890 100644 --- a/src/lang/da.rs +++ b/src/lang/da.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/de.rs b/src/lang/de.rs index 8df8acb95..4d2d8b466 100644 --- a/src/lang/de.rs +++ b/src/lang/de.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "Beim Start auf Softwareaktualisierung prüfen"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Bitte aktualisieren Sie RustDesk Server Pro auf die Version {} oder neuer!"), ("pull_group_failed_tip", "Aktualisierung der Gruppe fehlgeschlagen"), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/el.rs b/src/lang/el.rs index a371721c3..76327d0ea 100644 --- a/src/lang/el.rs +++ b/src/lang/el.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/eo.rs b/src/lang/eo.rs index 95b95c941..9b73932f2 100644 --- a/src/lang/eo.rs +++ b/src/lang/eo.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/es.rs b/src/lang/es.rs index a1faef630..4de8a142e 100644 --- a/src/lang/es.rs +++ b/src/lang/es.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "Comprobar actualización al iniciar"), ("upgrade_rustdesk_server_pro_to_{}_tip", "¡Por favor, actualiza RustDesk Server Pro a la versión {} o superior"), ("pull_group_failed_tip", "No se ha podido refrescar el grupo"), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fa.rs b/src/lang/fa.rs index 2ea2e3098..25a526377 100644 --- a/src/lang/fa.rs +++ b/src/lang/fa.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/fr.rs b/src/lang/fr.rs index 1c0b92817..16022b6f5 100644 --- a/src/lang/fr.rs +++ b/src/lang/fr.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "Vérifier la disponibilité des mises à jour au démarrage"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Veuillez mettre à jour RustDesk Server Pro avec la version {} ou une version plus récente !"), ("pull_group_failed_tip", "Échec de l'actualisation du groupe"), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/hu.rs b/src/lang/hu.rs index afe29cef8..bb3388341 100644 --- a/src/lang/hu.rs +++ b/src/lang/hu.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/id.rs b/src/lang/id.rs index 19945a3b9..967ff2bcd 100644 --- a/src/lang/id.rs +++ b/src/lang/id.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "Periksa pembaruan aplikasi saat sistem dinyalakan."), ("upgrade_rustdesk_server_pro_to_{}_tip", "Silahkan perbarui RustDesk Server Pro ke versi {} atau yang lebih baru!"), ("pull_group_failed_tip", "Gagal memperbarui grup"), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/it.rs b/src/lang/it.rs index d1dc5e660..e0a944036 100644 --- a/src/lang/it.rs +++ b/src/lang/it.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "All'avvio verifica presenza aggiornamenti programma"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Aggiorna RustDesk Server Pro alla versione {} o successiva!"), ("pull_group_failed_tip", "Impossibile aggiornare il gruppo"), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ja.rs b/src/lang/ja.rs index 435ea3ff9..04b00dbfe 100644 --- a/src/lang/ja.rs +++ b/src/lang/ja.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ko.rs b/src/lang/ko.rs index a74ebca51..4d8677c81 100644 --- a/src/lang/ko.rs +++ b/src/lang/ko.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/kz.rs b/src/lang/kz.rs index 5eeb06b18..2eab96f76 100644 --- a/src/lang/kz.rs +++ b/src/lang/kz.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lt.rs b/src/lang/lt.rs index 5342596b1..c2dece955 100644 --- a/src/lang/lt.rs +++ b/src/lang/lt.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/lv.rs b/src/lang/lv.rs index 167452db4..b1abd922b 100644 --- a/src/lang/lv.rs +++ b/src/lang/lv.rs @@ -57,6 +57,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("ID Server", "ID serveris"), ("Relay Server", "Releja serveris"), ("API Server", "API serveris"), + ("Key", "Atslēga"), ("invalid_http", "jāsākas ar http:// vai https://"), ("Invalid IP", "Nederīga IP"), ("Invalid format", "Nederīgs formāts"), @@ -296,6 +297,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("This file exists, skip or overwrite this file?", "Šis fails pastāv, izlaist vai pārrakstīt šo failu?"), ("Quit", "Iziet"), ("doc_mac_permission", "https://rustdesk.com/docs/en/manual/mac/#enable-permissions"), + ("doc_fix_wayland", "https://rustdesk.com/docs/en/manual/linux/#x11-required"), ("Help", "Palīdzība"), ("Failed", "Neizdevās"), ("Succeeded", "Izdevās"), @@ -479,6 +481,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Me", "Es"), ("identical_file_tip", "Šis fails ir identisks sesijas failam."), ("show_monitors_tip", "Rādīt monitorus rīkjoslā"), + ("enter_rustdesk_passwd_tip", "Ievadiet RustDesk paroli"), ("View Mode", "Skatīšanas režīms"), ("login_linux_tip", "Jums ir jāpiesakās attālajā Linux kontā, lai iespējotu X darbvirsmas sesiju"), ("verify_rustdesk_password_tip", "Pārbaudīt RustDesk paroli"), @@ -557,6 +560,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "Startējot pārbaudīt, vai nav programmatūras atjauninājumu"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Lūdzu, jauniniet RustDesk Server Pro uz versiju {} vai jaunāku!"), ("pull_group_failed_tip", "Neizdevās atsvaidzināt grupu"), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/nl.rs b/src/lang/nl.rs index dfd1b121f..b879a896c 100644 --- a/src/lang/nl.rs +++ b/src/lang/nl.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pl.rs b/src/lang/pl.rs index 0f273a121..71813688c 100644 --- a/src/lang/pl.rs +++ b/src/lang/pl.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "Sprawdź aktualizacje przy starcie programu"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Proszę zaktualizować RustDesk Server Pro do wersji {} lub nowszej!"), ("pull_group_failed_tip", "Błąd odświeżania grup"), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/pt_PT.rs b/src/lang/pt_PT.rs index a42baf7d7..f540bc76d 100644 --- a/src/lang/pt_PT.rs +++ b/src/lang/pt_PT.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ptbr.rs b/src/lang/ptbr.rs index aea4c4134..719886a18 100644 --- a/src/lang/ptbr.rs +++ b/src/lang/ptbr.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ro.rs b/src/lang/ro.rs index 5c05f88c0..b347278fc 100644 --- a/src/lang/ro.rs +++ b/src/lang/ro.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ru.rs b/src/lang/ru.rs index da3ab1704..3556bdbd0 100644 --- a/src/lang/ru.rs +++ b/src/lang/ru.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", "Проверять обновления программы при запуске"), ("upgrade_rustdesk_server_pro_to_{}_tip", "Обновите RustDesk Server Pro до версии {} или новее!"), ("pull_group_failed_tip", "Невозможно обновить группу"), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sk.rs b/src/lang/sk.rs index aaa8a1d1d..05c3160fd 100644 --- a/src/lang/sk.rs +++ b/src/lang/sk.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sl.rs b/src/lang/sl.rs index da32b5805..c22b2ecd1 100755 --- a/src/lang/sl.rs +++ b/src/lang/sl.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sq.rs b/src/lang/sq.rs index 1e1ce6427..d0875114d 100644 --- a/src/lang/sq.rs +++ b/src/lang/sq.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sr.rs b/src/lang/sr.rs index 527242a14..13819f37e 100644 --- a/src/lang/sr.rs +++ b/src/lang/sr.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/sv.rs b/src/lang/sv.rs index 5f6d15dfc..e54b7c7b6 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/template.rs b/src/lang/template.rs index 282370744..e442c826e 100644 --- a/src/lang/template.rs +++ b/src/lang/template.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/th.rs b/src/lang/th.rs index edb5f857d..2629540d2 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tr.rs b/src/lang/tr.rs index 89db0f029..20a1ce942 100644 --- a/src/lang/tr.rs +++ b/src/lang/tr.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/tw.rs b/src/lang/tw.rs index 002bf2473..0074e8afb 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/ua.rs b/src/lang/ua.rs index 182caec7f..facada5f1 100644 --- a/src/lang/ua.rs +++ b/src/lang/ua.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } diff --git a/src/lang/vn.rs b/src/lang/vn.rs index fd86d9b74..9eec26b0c 100644 --- a/src/lang/vn.rs +++ b/src/lang/vn.rs @@ -557,6 +557,5 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Check for software update on startup", ""), ("upgrade_rustdesk_server_pro_to_{}_tip", ""), ("pull_group_failed_tip", ""), - ("No permission", ""), ].iter().cloned().collect(); } From 253c8118a230641438486e859787871c2fe7cc10 Mon Sep 17 00:00:00 2001 From: leroyloren <57643470+leroyloren@users.noreply.github.com> Date: Sun, 1 Oct 2023 18:54:47 +0200 Subject: [PATCH 51/71] Update cs.rs --- src/lang/cs.rs | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/lang/cs.rs b/src/lang/cs.rs index cd7f3a306..cc6d48e59 100644 --- a/src/lang/cs.rs +++ b/src/lang/cs.rs @@ -538,24 +538,24 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("pull_ab_failed_tip", "Nepodařilo se obnovit adresář"), ("push_ab_failed_tip", "Nepodařilo se synchronizovat adresář se serverem"), ("synced_peer_readded_tip", "Zařízení, která byla přítomna v posledních relacích, budou synchronizována zpět do adresáře."), - ("Change Color", ""), - ("Primary Color", ""), - ("HSV Color", ""), - ("Installation Successful!", ""), - ("Installation failed!", ""), - ("Reverse mouse wheel", ""), - ("{} sessions", ""), - ("scam_title", ""), - ("scam_text1", ""), - ("scam_text2", ""), - ("Don't show again", ""), - ("I Agree", ""), - ("Decline", ""), - ("Timeout in minutes", ""), - ("auto_disconnect_option_tip", ""), - ("Connection failed due to inactivity", ""), - ("Check for software update on startup", ""), - ("upgrade_rustdesk_server_pro_to_{}_tip", ""), - ("pull_group_failed_tip", ""), + ("Change Color", "Změna barvy"), + ("Primary Color", "Základní barva"), + ("HSV Color", "HSV barva"), + ("Installation Successful!", "Instalace úspěšná!"), + ("Installation failed!", "Instalace se nezdařila!"), + ("Reverse mouse wheel", "Reverzní kolečko myši"), + ("{} sessions", "{} sezení"), + ("scam_title", "Možná vás někdo PODVEDL!"), + ("scam_text1", "Pokud telefonujete s někým, koho NEZNÁTE a komu NEDŮVĚŘUJETE a kdo vás požádal o použití služby RustDesk a její spuštění, nepokračujte v hovoru a okamžitě zavěste."), + ("scam_text2", "Pravděpodobně se jedná o podvodníka, který se snaží ukrást vaše peníze nebo jiné soukromé informace."), + ("Don't show again", "Znovu se neukázat"), + ("I Agree", "Souhlasím"), + ("Decline", "Odmítnout"), + ("Timeout in minutes", "Časový limit v minutách"), + ("auto_disconnect_option_tip", "Automatické ukončení příchozích relací při nečinnosti uživatele"), + ("Connection failed due to inactivity", "Připojení se nezdařilo z důvodu nečinnosti"), + ("Check for software update on startup", "Kontrola aktualizace softwaru při spuštění"), + ("upgrade_rustdesk_server_pro_to_{}_tip", "Upgradujte prosím RustDesk Server Pro na verzi {} nebo novější!"), + ("pull_group_failed_tip", "Nepodařilo se obnovit skupinu"), ].iter().cloned().collect(); } From 863c8de28ee9a02626403a4a2fd61ea1c6dfa1bf Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 2 Oct 2023 10:15:20 +0800 Subject: [PATCH 52/71] fix, one tap results double tap event Signed-off-by: fufesou --- flutter/lib/common/widgets/remote_input.dart | 4 +++- flutter/lib/mobile/pages/remote_page.dart | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/flutter/lib/common/widgets/remote_input.dart b/flutter/lib/common/widgets/remote_input.dart index b00cd1fb4..e2bb86e43 100644 --- a/flutter/lib/common/widgets/remote_input.dart +++ b/flutter/lib/common/widgets/remote_input.dart @@ -112,7 +112,9 @@ class _RawTouchGestureDetectorRegionState if (lastDeviceKind != PointerDeviceKind.touch) { return; } - inputModel.tap(MouseButtons.left); + if (!handleTouch) { + inputModel.tap(MouseButtons.left); + } } onDoubleTapDown(TapDownDetails d) { diff --git a/flutter/lib/mobile/pages/remote_page.dart b/flutter/lib/mobile/pages/remote_page.dart index f638fb2e8..f5b6270f9 100644 --- a/flutter/lib/mobile/pages/remote_page.dart +++ b/flutter/lib/mobile/pages/remote_page.dart @@ -421,9 +421,8 @@ class _RemotePageState extends State { ); } - // to-do: Check if peer is ios. - bool get isPeerMobile => kPeerPlatformAndroid == gFFI.ffiModel.pi.platform; - bool get showCursorPaint => !isPeerMobile && !gFFI.canvasModel.cursorEmbedded; + bool get showCursorPaint => + !gFFI.ffiModel.isPeerAndroid && !gFFI.canvasModel.cursorEmbedded; Widget getBodyForMobile() { final keyboardIsVisible = keyboardVisibilityController.isVisible; From 315a2a695fd383e16e677e00685fca9b3f833854 Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 2 Oct 2023 12:17:11 +0800 Subject: [PATCH 53/71] add comments Signed-off-by: fufesou --- flutter/lib/common/widgets/remote_input.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flutter/lib/common/widgets/remote_input.dart b/flutter/lib/common/widgets/remote_input.dart index e2bb86e43..a07bffa47 100644 --- a/flutter/lib/common/widgets/remote_input.dart +++ b/flutter/lib/common/widgets/remote_input.dart @@ -93,6 +93,7 @@ class _RawTouchGestureDetectorRegionState return; } if (handleTouch) { + // Desktop or mobile "Touch mode" ffi.cursorModel.move(d.localPosition.dx, d.localPosition.dy); inputModel.tapDown(MouseButtons.left); } @@ -113,6 +114,7 @@ class _RawTouchGestureDetectorRegionState return; } if (!handleTouch) { + // Mobile, "Mouse mode" inputModel.tap(MouseButtons.left); } } From 0a60d7016dc39678f8791ad1b9740f09fb794034 Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 2 Oct 2023 20:17:43 +0800 Subject: [PATCH 54/71] fix, sciter, reconnect, check thread running before the state Signed-off-by: fufesou --- src/ui_session_interface.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ui_session_interface.rs b/src/ui_session_interface.rs index 9a07782b9..e1923b04a 100644 --- a/src/ui_session_interface.rs +++ b/src/ui_session_interface.rs @@ -888,10 +888,12 @@ impl Session { // 2. If the connection is established, send `Data::Close`. // 3. If the connection is disconnected, do nothing. let mut connection_round_state_lock = self.connection_round_state.lock().unwrap(); - match connection_round_state_lock.state { - ConnectionState::Connecting => return, - ConnectionState::Connected => self.send(Data::Close), - ConnectionState::Disconnected => {} + if self.thread.lock().unwrap().is_some() { + match connection_round_state_lock.state { + ConnectionState::Connecting => return, + ConnectionState::Connected => self.send(Data::Close), + ConnectionState::Disconnected => {} + } } let round = connection_round_state_lock.new_round(); drop(connection_round_state_lock); From 022b8ec13a5b54686f9e2fc1c4265817a0e33bc9 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Mon, 2 Oct 2023 17:48:09 +0200 Subject: [PATCH 55/71] Update sv.rs --- src/lang/sv.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lang/sv.rs b/src/lang/sv.rs index e54b7c7b6..2440462dd 100644 --- a/src/lang/sv.rs +++ b/src/lang/sv.rs @@ -37,7 +37,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Clipboard is empty", "Urklippet är tomt"), ("Stop service", "Avsluta tjänsten"), ("Change ID", "Byt ID"), - ("Your new ID", ""), + ("Your new ID", "Ditt nya ID"), ("length %min% to %max%", ""), ("starts with a letter", ""), ("allowed characters", ""), @@ -145,7 +145,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Failed to make direct connection to remote desktop", "Lyckades inte ansluta direkt till fjärrskrivbordet"), ("Set Password", "Välj lösenord"), ("OS Password", "OS lösenord"), - ("install_tip", "På grund av UAC, kan inte RustDesk fungera ordentligt på klientsidan. För att undvika UAC, tryck på knappen nedan för att installera RustDesk på systemet."), + ("install_tip", "På grund av UAC, kan inte RustDesk fungera ordentligt på klientsidan. För att undvika problem med UAC, tryck på knappen nedan för att installera RustDesk på systemet."), ("Click to upgrade", "Klicka för att nedgradera"), ("Click to download", "Klicka för att ladda ner"), ("Click to update", "Klicka för att uppdatera"), @@ -213,14 +213,14 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Closed manually by the peer", "Stängd manuellt av klienten"), ("Enable remote configuration modification", "Tillåt fjärrkonfigurering"), ("Run without install", "Kör utan installation"), - ("Connect via relay", ""), + ("Connect via relay", "Anslut via relay"), ("Always connect via relay", "Anslut alltid via relay"), ("whitelist_tip", "Bara vitlistade IPs kan koppla upp till mig"), ("Login", "Logga in"), - ("Verify", ""), - ("Remember me", ""), - ("Trust this device", ""), - ("Verification code", ""), + ("Verify", "Verifiera"), + ("Remember me", "Kom ihåg mig"), + ("Trust this device", "Lita på denna enhet"), + ("Verification code", "Verifikationskod"), ("verification_tip", ""), ("Logout", "Logga ut"), ("Tags", "Taggar"), @@ -364,8 +364,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Disconnect all devices?", "Koppla ifrån alla enheter?"), ("Clear", "Töm"), ("Audio Input Device", "Inmatningsenhet för ljud"), - ("Use IP Whitelisting", "Använd IP Vitlistning"), - ("Network", "Nätvärk"), + ("Use IP Whitelisting", "Använd IP-Vitlistning"), + ("Network", "Nätverk"), ("Enable RDP", "Aktivera RDP"), ("Pin Toolbar", ""), ("Unpin Toolbar", ""), From 7a482fd22aab61e3aabd7e25e2ffb986955ccf74 Mon Sep 17 00:00:00 2001 From: Sahil Yeole Date: Mon, 2 Oct 2023 21:22:40 +0530 Subject: [PATCH 56/71] fix wayland screen prompt on display menu Signed-off-by: Sahil Yeole --- flutter/lib/desktop/widgets/remote_toolbar.dart | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/flutter/lib/desktop/widgets/remote_toolbar.dart b/flutter/lib/desktop/widgets/remote_toolbar.dart index 8f668f7ad..e7d81dfec 100644 --- a/flutter/lib/desktop/widgets/remote_toolbar.dart +++ b/flutter/lib/desktop/widgets/remote_toolbar.dart @@ -1053,10 +1053,12 @@ class _ResolutionsMenuState extends State<_ResolutionsMenu> { FfiModel get ffiModel => widget.ffi.ffiModel; Display get display => ffiModel.display; List get resolutions => pi.resolutions; + bool get isWayland => bind.mainCurrentIsWayland(); @override void initState() { super.initState(); + _getLocalResolutionWayland(); } @override @@ -1065,7 +1067,6 @@ class _ResolutionsMenuState extends State<_ResolutionsMenu> { final visible = ffiModel.keyboard && (isVirtualDisplay || resolutions.length > 1); if (!visible) return Offstage(); - _getLocalResolution(); final showOriginalBtn = display.isOriginalResolutionSet && !display.isOriginalResolution; final showFitLocalBtn = !_isRemoteResolutionFitLocal(); @@ -1101,6 +1102,20 @@ class _ResolutionsMenuState extends State<_ResolutionsMenu> { ); } + Future _getLocalResolutionWayland() async { + if (!isWayland) return _getLocalResolution(); + final window = await window_size.getWindowInfo(); + final screen = window.screen; + if (screen != null) { + setState(() { + _localResolution = Resolution( + screen.frame.width.toInt(), + screen.frame.height.toInt(), + ); + }); + } + } + _getLocalResolution() { _localResolution = null; final String currentDisplay = bind.mainGetCurrentDisplay(); From 70c0edcbe764b2b806aa8fae3cc984cb8895bc12 Mon Sep 17 00:00:00 2001 From: 21pages Date: Mon, 2 Oct 2023 19:32:28 +0800 Subject: [PATCH 57/71] mobile peer tab right actions dropdown Signed-off-by: 21pages --- flutter/assets/checkbox-outline.svg | 1 + flutter/assets/checkbox.ttf | Bin 1728 -> 0 bytes flutter/assets/chevron_up_chevron_down.svg | 1 + flutter/lib/common.dart | 1 - flutter/lib/common/widgets/peer_tab_page.dart | 185 ++++++++++++++---- flutter/pubspec.lock | 8 + flutter/pubspec.yaml | 4 +- 7 files changed, 159 insertions(+), 41 deletions(-) create mode 100644 flutter/assets/checkbox-outline.svg delete mode 100644 flutter/assets/checkbox.ttf create mode 100644 flutter/assets/chevron_up_chevron_down.svg diff --git a/flutter/assets/checkbox-outline.svg b/flutter/assets/checkbox-outline.svg new file mode 100644 index 000000000..77ca35529 --- /dev/null +++ b/flutter/assets/checkbox-outline.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/flutter/assets/checkbox.ttf b/flutter/assets/checkbox.ttf deleted file mode 100644 index 70ddde69842369c9634906a967604c5bfcff2e86..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1728 zcmd^9OK%%h6#nj=vEz)vZ5~9(MP=$VUO=%^0|E6BMJ-Jv1QfL)LI?>aOf2+2X z>)!(mpZ=Q-&#BH${QN3$pZ`LG#Mq8;gZKyjCmXGJGef}KyHpuJbRE2@Y@wcrFM#z+D|0+oToSF8(;9IO`?beV6IRW#YHjm zq?lS1$HkaPkEKo&O5*v6=N84YCo0FqV-wRkAqr`ZGb9%1Db9*-b5>_uPUpwp`YUs6 zT4wg|TRGwH^=8i&3TJ2KQZnv+o-Y>ja!Ki4wrk}lrBxLtEjf|5_Ip{;KM0*oQVkUI zd%aOo()A>EbpOByHqH&u1d5tYRjY}G5S+T8d zpE=HXinyV%z)^gou|y8HG&acpq_Ii-tHvqJU{~Wb`8|y-tcgc8&Y~#Xi;?HVUe#XT zvYT!g)WRShjaR(-hVMipb2P4bQKuOO_UY36h+6RiFB+BUT(4K+xMtU)uw^f^p6C0a z-HyU*o*S1Maoj#rE~|MIUvk41pSlPh9K_UB*jUFFbrUW^1gIrCe#pMU=sGswGc$U~ zdpLWI(Gfa~Q#EazMv2eX;iwfx1xe)LZaTQm*(&TYW=A&vh?QDI%ep_0o%qBy4^a88 zv5w2=5*kTXn@@F_-)KFf_)@aY*6?*z*G;{z|0PmL!Si+-p8MW \ No newline at end of file diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 858756ed2..93c23d59d 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -91,7 +91,6 @@ class IconFont { static const IconData roundClose = IconData(0xe6ed, fontFamily: _family2); static const IconData addressBook = IconData(0xe602, fontFamily: "AddressBook"); - static const IconData checkbox = IconData(0xe7d6, fontFamily: "CheckBox"); } class ColorThemeExtension extends ThemeExtension { diff --git a/flutter/lib/common/widgets/peer_tab_page.dart b/flutter/lib/common/widgets/peer_tab_page.dart index 8f02a5c77..b5143eb82 100644 --- a/flutter/lib/common/widgets/peer_tab_page.dart +++ b/flutter/lib/common/widgets/peer_tab_page.dart @@ -15,8 +15,10 @@ import 'package:flutter_hbb/desktop/widgets/tabbar_widget.dart'; import 'package:flutter_hbb/models/ab_model.dart'; import 'package:flutter_hbb/models/peer_tab_model.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; +import 'package:pull_down_button/pull_down_button.dart'; import '../../common.dart'; import '../../models/platform_model.dart'; @@ -110,39 +112,10 @@ class _PeerTabPageState extends State Expanded( child: visibleContextMenuListener(_createSwitchBar(context))), - const PeerSearchBar().marginOnly(right: isMobile ? 0 : 13), - _createRefresh( - index: PeerTabIndex.ab, loading: gFFI.abModel.abLoading), - _createRefresh( - index: PeerTabIndex.group, - loading: gFFI.groupModel.groupLoading), - _createMultiSelection(), - Offstage( - offstage: !isDesktop, - child: _createPeerViewTypeSwitch(context)), - Offstage( - offstage: gFFI.peerTabModel.currentTab == 0, - child: PeerSortDropdown(), - ), - Offstage( - offstage: gFFI.peerTabModel.currentTab != 3, - child: _hoverAction( - context: context, - hoverableWhenfalse: hideAbTagsPanel, - child: Tooltip( - message: translate('Toggle Tags'), - child: Icon( - Icons.tag_rounded, - size: 18, - )), - onTap: () async { - await bind.mainSetLocalOption( - key: "hideAbTagsPanel", - value: hideAbTagsPanel.value ? "" : "Y"); - hideAbTagsPanel.value = !hideAbTagsPanel.value; - }, - ), - ), + if (isMobile) + ..._mobileRightActions(context) + else + ..._desktopRightActions(context) ], )), ), @@ -270,17 +243,20 @@ class _PeerTabPageState extends State Widget _createMultiSelection() { final textColor = Theme.of(context).textTheme.titleLarge?.color; final model = Provider.of(context); - if (model.currentTabCachedPeers.isEmpty) return Offstage(); return _hoverAction( context: context, onTap: () { model.setMultiSelectionMode(true); + if (isMobile && Navigator.canPop(context)) { + Navigator.pop(context); + } }, child: Tooltip( message: translate('Select'), - child: Icon( - IconFont.checkbox, - size: 18, + child: SvgPicture.asset( + "assets/checkbox-outline.svg", + width: 18, + height: 18, color: textColor, )), ); @@ -564,6 +540,130 @@ class _PeerTabPageState extends State Tooltip(message: translate('Close'), child: Icon(Icons.clear))) .marginOnly(left: 6); } + + Widget _toggleTags() { + return _hoverAction( + context: context, + hoverableWhenfalse: hideAbTagsPanel, + child: Tooltip( + message: translate('Toggle Tags'), + child: Icon( + Icons.tag_rounded, + size: 18, + )), + onTap: () async { + await bind.mainSetLocalOption( + key: "hideAbTagsPanel", value: hideAbTagsPanel.value ? "" : "Y"); + hideAbTagsPanel.value = !hideAbTagsPanel.value; + }); + } + + List _desktopRightActions(BuildContext context) { + final model = Provider.of(context); + return [ + const PeerSearchBar().marginOnly(right: isMobile ? 0 : 13), + _createRefresh(index: PeerTabIndex.ab, loading: gFFI.abModel.abLoading), + _createRefresh( + index: PeerTabIndex.group, loading: gFFI.groupModel.groupLoading), + Offstage( + offstage: model.currentTabCachedPeers.isEmpty, + child: _createMultiSelection(), + ), + _createPeerViewTypeSwitch(context), + Offstage( + offstage: model.currentTab == PeerTabIndex.recent.index, + child: PeerSortDropdown(), + ), + Offstage( + offstage: model.currentTab != PeerTabIndex.ab.index, + child: _toggleTags(), + ), + ]; + } + + List _mobileRightActions(BuildContext context) { + final model = Provider.of(context); + final screenWidth = MediaQuery.of(context).size.width; + final leftIconSize = Theme.of(context).iconTheme.size ?? 24; + final leftActionsSize = + (leftIconSize + (4 + 4) * 2) * model.visibleIndexs.length; + final availableWidth = screenWidth - 10 * 2 - leftActionsSize - 2 * 2; + final searchWidth = 120; + final otherActionWidth = 18 + 10; + + dropDown(List menus) { + final padding = 6.0; + final textColor = Theme.of(context).textTheme.titleLarge?.color; + return PullDownButton( + buttonBuilder: + (BuildContext context, Future Function() showMenu) { + return _hoverAction( + context: context, + child: Tooltip( + message: translate('More'), + child: SvgPicture.asset( + "assets/chevron_up_chevron_down.svg", + width: 18, + height: 18, + color: textColor, + )), + onTap: showMenu, + ); + }, + routeTheme: PullDownMenuRouteTheme( + width: menus.length * (otherActionWidth + padding * 2) * 1.0), + itemBuilder: (context) => [ + PullDownMenuEntryImpl( + child: Row( + mainAxisSize: MainAxisSize.min, + children: menus + .map((e) => + Material(child: e.paddingSymmetric(horizontal: padding))) + .toList(), + ), + ) + ], + ); + } + + // Always show search, refresh + List actions = [ + const PeerSearchBar(), + if (model.currentTab == PeerTabIndex.ab.index) + _createRefresh(index: PeerTabIndex.ab, loading: gFFI.abModel.abLoading), + if (model.currentTab == PeerTabIndex.group.index) + _createRefresh( + index: PeerTabIndex.group, loading: gFFI.groupModel.groupLoading), + ]; + final List dynamicActions = [ + if (model.currentTabCachedPeers.isNotEmpty) _createMultiSelection(), + if (model.currentTab != PeerTabIndex.recent.index) PeerSortDropdown(), + if (model.currentTab == PeerTabIndex.ab.index) _toggleTags() + ]; + final rightWidth = availableWidth - + searchWidth - + (actions.length == 2 ? otherActionWidth : 0); + final availablePositions = rightWidth ~/ otherActionWidth; + debugPrint( + "dynamic action count:${dynamicActions.length}, available positions: $availablePositions"); + + if (availablePositions < dynamicActions.length && + dynamicActions.length > 1) { + if (availablePositions < 2) { + actions.addAll([ + dropDown(dynamicActions), + ]); + } else { + actions.addAll([ + ...dynamicActions.sublist(0, availablePositions - 1), + dropDown(dynamicActions.sublist(availablePositions - 1)), + ]); + } + } else { + actions.addAll(dynamicActions); + } + return actions; + } } class PeerSearchBar extends StatefulWidget { @@ -839,3 +939,14 @@ Widget _hoverAction( child: Container(padding: padding, child: child))), ); } + +class PullDownMenuEntryImpl extends StatelessWidget + implements PullDownMenuEntry { + final Widget child; + const PullDownMenuEntryImpl({super.key, required this.child}); + + @override + Widget build(BuildContext context) { + return child; + } +} diff --git a/flutter/pubspec.lock b/flutter/pubspec.lock index 559cb11ee..f57a4b92c 100644 --- a/flutter/pubspec.lock +++ b/flutter/pubspec.lock @@ -1045,6 +1045,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.1" + pull_down_button: + dependency: "direct main" + description: + name: pull_down_button + sha256: "235b302701ce029fd9e9470975069376a6700935bb47a5f1b3ec8a5efba07e6f" + url: "https://pub.dev" + source: hosted + version: "0.9.3" puppeteer: dependency: transitive description: diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index 478c9703c..c542dabae 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -104,6 +104,7 @@ dependencies: git: url: https://github.com/21pages/dynamic_layouts.git ref: 24cb88413fa5181d949ddacbb30a65d5c459e7d9 + pull_down_button: ^0.9.3 dev_dependencies: icons_launcher: ^2.0.4 @@ -156,9 +157,6 @@ flutter: - family: AddressBook fonts: - asset: assets/address_book.ttf - - family: CheckBox - fonts: - - asset: assets/checkbox.ttf # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. From 06987c4ca92f48fedfaaf5d97e9212e1bd0d1667 Mon Sep 17 00:00:00 2001 From: fufesou Date: Tue, 3 Oct 2023 09:51:21 +0800 Subject: [PATCH 58/71] refact, flutter sessions lock Signed-off-by: fufesou --- src/cli.rs | 10 +- src/client.rs | 12 +-- src/client/io_loop.rs | 4 +- src/flutter.rs | 117 +++++++++++++-------- src/flutter_ffi.rs | 141 +++++++++++++------------- src/keyboard.rs | 20 +--- src/plugin/native_handlers/session.rs | 12 +-- src/port_forward.rs | 3 +- src/ui_session_interface.rs | 39 ++++--- 9 files changed, 188 insertions(+), 170 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 0f49c5530..021ad899b 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -75,15 +75,15 @@ impl Interface for Session { } } - fn handle_login_error(&mut self, err: &str) -> bool { + fn handle_login_error(&self, err: &str) -> bool { handle_login_error(self.lc.clone(), err, self) } - fn handle_peer_info(&mut self, pi: PeerInfo) { + fn handle_peer_info(&self, pi: PeerInfo) { self.lc.write().unwrap().handle_peer_info(&pi); } - async fn handle_hash(&mut self, pass: &str, hash: Hash, peer: &mut Stream) { + async fn handle_hash(&self, pass: &str, hash: Hash, peer: &mut Stream) { log::info!( "password={}", hbb_common::password_security::temporary_password() @@ -92,7 +92,7 @@ impl Interface for Session { } async fn handle_login_from_ui( - &mut self, + &self, os_username: String, os_password: String, password: String, @@ -110,7 +110,7 @@ impl Interface for Session { .await; } - async fn handle_test_delay(&mut self, t: TestDelay, peer: &mut Stream) { + async fn handle_test_delay(&self, t: TestDelay, peer: &mut Stream) { handle_test_delay(t, peer).await; } diff --git a/src/client.rs b/src/client.rs index 85b6fc0f4..4ecb0a0fb 100644 --- a/src/client.rs +++ b/src/client.rs @@ -677,7 +677,7 @@ impl Client { #[cfg(not(any(target_os = "android", target_os = "ios")))] fn try_stop_clipboard(_self_uuid: &uuid::Uuid) { #[cfg(feature = "flutter")] - if crate::flutter::other_sessions_running(_self_uuid) { + if crate::flutter::sessions::other_sessions_running(_self_uuid) { return; } TEXT_CLIPBOARD_STATE.lock().unwrap().running = false; @@ -2417,21 +2417,21 @@ pub trait Interface: Send + Clone + 'static + Sized { /// Send message data to remote peer. fn send(&self, data: Data); fn msgbox(&self, msgtype: &str, title: &str, text: &str, link: &str); - fn handle_login_error(&mut self, err: &str) -> bool; - fn handle_peer_info(&mut self, pi: PeerInfo); + fn handle_login_error(&self, err: &str) -> bool; + fn handle_peer_info(&self, pi: PeerInfo); fn on_error(&self, err: &str) { self.msgbox("error", "Error", err, ""); } - async fn handle_hash(&mut self, pass: &str, hash: Hash, peer: &mut Stream); + async fn handle_hash(&self, pass: &str, hash: Hash, peer: &mut Stream); async fn handle_login_from_ui( - &mut self, + &self, os_username: String, os_password: String, password: String, remember: bool, peer: &mut Stream, ); - async fn handle_test_delay(&mut self, t: TestDelay, peer: &mut Stream); + async fn handle_test_delay(&self, t: TestDelay, peer: &mut Stream); fn get_login_config_handler(&self) -> Arc>; diff --git a/src/client/io_loop.rs b/src/client/io_loop.rs index c82e8a908..28edf0e52 100644 --- a/src/client/io_loop.rs +++ b/src/client/io_loop.rs @@ -816,7 +816,7 @@ impl Remote { job: &fs::TransferJob, elapsed: i32, last_update_jobs_status: &mut (Instant, HashMap), - handler: &mut Session, + handler: &Session, ) { if elapsed <= 0 { return; @@ -843,7 +843,7 @@ impl Remote { job, elapsed, &mut self.last_update_jobs_status, - &mut self.handler, + &self.handler, ); } for job in self.write_jobs.iter() { diff --git a/src/flutter.rs b/src/flutter.rs index 0f57e0a73..c9863078a 100644 --- a/src/flutter.rs +++ b/src/flutter.rs @@ -42,9 +42,10 @@ pub(crate) const APP_TYPE_CM: &str = "main"; // pub(crate) const APP_TYPE_DESKTOP_FILE_TRANSFER: &str = "file transfer"; // pub(crate) const APP_TYPE_DESKTOP_PORT_FORWARD: &str = "port forward"; +pub type FlutterSession = Arc>; + lazy_static::lazy_static! { pub(crate) static ref CUR_SESSION_ID: RwLock = Default::default(); - pub(crate) static ref SESSIONS: RwLock>> = Default::default(); static ref GLOBAL_EVENT_STREAM: RwLock>> = Default::default(); // rust to dart event channel } @@ -287,7 +288,7 @@ impl FlutterHandler { ) } - pub(crate) fn close_event_stream(&mut self) { + pub(crate) fn close_event_stream(&self) { let mut stream_lock = self.event_stream.write().unwrap(); if let Some(stream) = &*stream_lock { stream.add(EventToUI::Event("close".to_owned())); @@ -337,13 +338,13 @@ impl FlutterHandler { #[inline] #[cfg(feature = "flutter_texture_render")] - pub fn register_texture(&mut self, ptr: usize) { + pub fn register_texture(&self, ptr: usize) { *self.renderer.read().unwrap().ptr.write().unwrap() = ptr; } #[inline] #[cfg(feature = "flutter_texture_render")] - pub fn set_size(&mut self, width: usize, height: usize) { + pub fn set_size(&self, width: usize, height: usize) { *self.notify_rendered.write().unwrap() = false; self.renderer.write().unwrap().set_size(width, height); } @@ -731,7 +732,7 @@ pub fn session_add( switch_uuid: &str, force_relay: bool, password: String, -) -> ResultType> { +) -> ResultType { LocalConfig::set_remote_id(&id); let session: Session = Session { @@ -768,11 +769,8 @@ pub fn session_add( .unwrap() .initialize(id.to_owned(), conn_type, switch_uuid, force_relay); - if let Some(same_id_session) = SESSIONS - .write() - .unwrap() - .insert(session_id.to_owned(), session.clone()) - { + let session = Arc::new(session.clone()); + if let Some(same_id_session) = sessions::add_session(session_id.to_owned(), session.clone()) { log::error!("Should not happen"); same_id_session.close(); } @@ -791,7 +789,7 @@ pub fn session_start_( id: &str, event_stream: StreamSink, ) -> ResultType<()> { - if let Some(session) = SESSIONS.write().unwrap().get_mut(session_id) { + if let Some(session) = sessions::get_session(session_id) { #[cfg(feature = "flutter_texture_render")] log::info!( "Session {} start, render by flutter texture rgba plugin", @@ -803,7 +801,7 @@ pub fn session_start_( session.close_event_stream(); *session.event_stream.write().unwrap() = Some(event_stream); if !is_pre_added { - let session = session.clone(); + let session = (*session).clone(); std::thread::spawn(move || { let round = session.connection_round_state.lock().unwrap().new_round(); io_loop(session, round); @@ -817,29 +815,15 @@ pub fn session_start_( #[cfg(not(any(target_os = "android", target_os = "ios")))] pub fn update_text_clipboard_required() { - let is_required = SESSIONS - .read() - .unwrap() + let is_required = sessions::get_sessions() .iter() - .any(|(_id, session)| session.is_text_clipboard_required()); + .any(|session| session.is_text_clipboard_required()); Client::set_is_text_clipboard_required(is_required); } -#[inline] -#[cfg(not(any(target_os = "android", target_os = "ios")))] -pub fn other_sessions_running(session_id: &SessionID) -> bool { - SESSIONS - .read() - .unwrap() - .keys() - .filter(|k| *k != session_id) - .count() - != 0 -} - #[cfg(not(any(target_os = "android", target_os = "ios")))] pub fn send_text_clipboard_msg(msg: Message) { - for (_id, session) in SESSIONS.read().unwrap().iter() { + for session in sessions::get_sessions() { if session.is_text_clipboard_required() { session.send(Data::Message(msg.clone())); } @@ -1052,7 +1036,7 @@ fn char_to_session_id(c: *const char) -> ResultType { pub fn session_get_rgba_size(_session_id: SessionID) -> usize { #[cfg(not(feature = "flutter_texture_render"))] - if let Some(session) = SESSIONS.read().unwrap().get(&_session_id) { + if let Some(session) = sessions::get_session(&_session_id) { return session.rgba.read().unwrap().len(); } 0 @@ -1061,7 +1045,7 @@ pub fn session_get_rgba_size(_session_id: SessionID) -> usize { #[no_mangle] pub extern "C" fn session_get_rgba(session_uuid_str: *const char) -> *const u8 { if let Ok(session_id) = char_to_session_id(session_uuid_str) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { return session.get_rgba(); } } @@ -1070,7 +1054,7 @@ pub extern "C" fn session_get_rgba(session_uuid_str: *const char) -> *const u8 { } pub fn session_next_rgba(session_id: SessionID) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { return session.next_rgba(); } } @@ -1078,7 +1062,7 @@ pub fn session_next_rgba(session_id: SessionID) { #[inline] pub fn session_register_texture(_session_id: SessionID, _ptr: usize) { #[cfg(feature = "flutter_texture_render")] - if let Some(session) = SESSIONS.write().unwrap().get_mut(&_session_id) { + if let Some(session) = sessions::get_session(&_session_id) { session.register_texture(_ptr); return; } @@ -1090,11 +1074,7 @@ pub fn push_session_event( name: &str, event: Vec<(&str, &str)>, ) -> Option { - SESSIONS - .read() - .unwrap() - .get(session_id)? - .push_event(name, event) + sessions::get_session(session_id)?.push_event(name, event) } #[inline] @@ -1143,7 +1123,7 @@ fn session_send_touch_scale( ) { match v.get("v").and_then(|s| s.as_i64()) { Some(scale) => { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.send_touch_scale(scale as _, alt, ctrl, shift, command); } } @@ -1167,7 +1147,7 @@ fn session_send_touch_pan( v.get("y").and_then(|y| y.as_i64()), ) { (Some(x), Some(y)) => { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session .send_touch_pan_event(pan_event, x as _, y as _, alt, ctrl, shift, command); } @@ -1216,3 +1196,60 @@ pub fn session_send_pointer(session_id: SessionID, msg: String) { pub enum SessionHook { OnSessionRgba(fn(String, &mut scrap::ImageRgb)), } + +#[inline] +pub fn get_cur_session() -> Option { + sessions::get_session(&*CUR_SESSION_ID.read().unwrap()) +} + +// sessions mod is used to avoid the big lock of sessions' map. +pub mod sessions { + use super::*; + + lazy_static::lazy_static! { + static ref SESSIONS: RwLock> = Default::default(); + } + + #[inline] + pub fn add_session(session_id: SessionID, session: FlutterSession) -> Option { + SESSIONS.write().unwrap().insert(session_id, session) + } + + #[inline] + pub fn remove_session(session_id: &SessionID) -> Option { + SESSIONS.write().unwrap().remove(session_id) + } + + #[inline] + pub fn get_session(session_id: &SessionID) -> Option { + SESSIONS.read().unwrap().get(session_id).cloned() + } + + #[inline] + pub fn get_sessions() -> Vec { + SESSIONS.read().unwrap().values().cloned().collect() + } + + #[inline] + pub fn get_session_by_peer_id(peer_id: &str) -> Option { + SESSIONS + .read() + .unwrap() + .values() + .find(|session| session.id == peer_id) + .map(|s| s.clone()) + .clone() + } + + #[inline] + #[cfg(not(any(target_os = "android", target_os = "ios")))] + pub fn other_sessions_running(session_id: &SessionID) -> bool { + SESSIONS + .read() + .unwrap() + .keys() + .filter(|k| *k != session_id) + .count() + != 0 + } +} diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index 63ced340d..c931d8926 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -4,8 +4,7 @@ use crate::{ client::file_trait::FileManager, common::is_keyboard_mode_supported, common::make_fd_to_json, - flutter::{self, SESSIONS}, - flutter::{session_add, session_start_}, + flutter::{self, session_add, session_start_, sessions}, input::*, ui_interface::{self, *}, }; @@ -113,7 +112,7 @@ pub fn session_start( } pub fn session_get_remember(session_id: SessionID) -> Option { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { Some(session.get_remember()) } else { None @@ -121,7 +120,7 @@ pub fn session_get_remember(session_id: SessionID) -> Option { } pub fn session_get_toggle_option(session_id: SessionID, arg: String) -> Option { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { Some(session.get_toggle_option(arg)) } else { None @@ -134,7 +133,7 @@ pub fn session_get_toggle_option_sync(session_id: SessionID, arg: String) -> Syn } pub fn session_get_option(session_id: SessionID, arg: String) -> Option { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { Some(session.get_option(arg)) } else { None @@ -148,55 +147,55 @@ pub fn session_login( password: String, remember: bool, ) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.login(os_username, os_password, password, remember); } } pub fn session_close(session_id: SessionID) { - if let Some(mut session) = SESSIONS.write().unwrap().remove(&session_id) { + if let Some(session) = sessions::remove_session(&session_id) { session.close_event_stream(); session.close(); } } pub fn session_refresh(session_id: SessionID) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.refresh_video(); } } pub fn session_record_screen(session_id: SessionID, start: bool, width: usize, height: usize) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.record_screen(start, width as _, height as _); } } pub fn session_record_status(session_id: SessionID, status: bool) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.record_status(status); } } pub fn session_reconnect(session_id: SessionID, force_relay: bool) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.reconnect(force_relay); } } pub fn session_toggle_option(session_id: SessionID, value: String) { - if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { log::warn!("toggle option {}", &value); session.toggle_option(value.clone()); } #[cfg(not(any(target_os = "android", target_os = "ios")))] - if SESSIONS.read().unwrap().get(&session_id).is_some() && value == "disable-clipboard" { + if sessions::get_session(&session_id).is_some() && value == "disable-clipboard" { crate::flutter::update_text_clipboard_required(); } } pub fn session_get_flutter_option(session_id: SessionID, k: String) -> Option { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { Some(session.get_flutter_option(k)) } else { None @@ -204,13 +203,13 @@ pub fn session_get_flutter_option(session_id: SessionID, k: String) -> Option Option { - if let Some((_, session)) = SESSIONS.read().unwrap().iter().find(|(_, s)| s.id == id) { + if let Some(session) = sessions::get_session_by_peer_id(&id) { Some(session.get_flutter_option(k)) } else { None @@ -239,7 +238,7 @@ pub fn set_local_kb_layout_type(kb_layout_type: String) { } pub fn session_get_view_style(session_id: SessionID) -> Option { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { Some(session.get_view_style()) } else { None @@ -247,13 +246,13 @@ pub fn session_get_view_style(session_id: SessionID) -> Option { } pub fn session_set_view_style(session_id: SessionID, value: String) { - if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.save_view_style(value); } } pub fn session_get_scroll_style(session_id: SessionID) -> Option { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { Some(session.get_scroll_style()) } else { None @@ -261,13 +260,13 @@ pub fn session_get_scroll_style(session_id: SessionID) -> Option { } pub fn session_set_scroll_style(session_id: SessionID, value: String) { - if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.save_scroll_style(value); } } pub fn session_get_image_quality(session_id: SessionID) -> Option { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { Some(session.get_image_quality()) } else { None @@ -275,13 +274,13 @@ pub fn session_get_image_quality(session_id: SessionID) -> Option { } pub fn session_set_image_quality(session_id: SessionID, value: String) { - if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.save_image_quality(value); } } pub fn session_get_keyboard_mode(session_id: SessionID) -> Option { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { Some(session.get_keyboard_mode()) } else { None @@ -290,7 +289,7 @@ pub fn session_get_keyboard_mode(session_id: SessionID) -> Option { pub fn session_set_keyboard_mode(session_id: SessionID, value: String) { let mut _mode_updated = false; - if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.save_keyboard_mode(value.clone()); _mode_updated = true; } @@ -301,7 +300,7 @@ pub fn session_set_keyboard_mode(session_id: SessionID, value: String) { } pub fn session_get_reverse_mouse_wheel(session_id: SessionID) -> Option { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { Some(session.get_reverse_mouse_wheel()) } else { None @@ -309,13 +308,13 @@ pub fn session_get_reverse_mouse_wheel(session_id: SessionID) -> Option } pub fn session_set_reverse_mouse_wheel(session_id: SessionID, value: String) { - if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.save_reverse_mouse_wheel(value); } } pub fn session_get_custom_image_quality(session_id: SessionID) -> Option> { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { Some(session.get_custom_image_quality()) } else { None @@ -323,7 +322,7 @@ pub fn session_get_custom_image_quality(session_id: SessionID) -> Option SyncReturn { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { if let Ok(mode) = KeyboardMode::from_str(&mode[..]) { SyncReturn(is_keyboard_mode_supported( &mode, @@ -338,31 +337,31 @@ pub fn session_is_keyboard_mode_supported(session_id: SessionID, mode: String) - } pub fn session_set_custom_image_quality(session_id: SessionID, value: i32) { - if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.save_custom_image_quality(value); } } pub fn session_set_custom_fps(session_id: SessionID, fps: i32) { - if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.set_custom_fps(fps); } } pub fn session_lock_screen(session_id: SessionID) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.lock_screen(); } } pub fn session_ctrl_alt_del(session_id: SessionID) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.ctrl_alt_del(); } } pub fn session_switch_display(session_id: SessionID, value: i32) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.switch_display(value); } } @@ -375,7 +374,7 @@ pub fn session_handle_flutter_key_event( lock_modes: i32, down_or_up: bool, ) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { let keyboard_mode = session.get_keyboard_mode(); session.handle_flutter_key_event( &keyboard_mode, @@ -396,7 +395,7 @@ pub fn session_handle_flutter_key_event( // This will cause the keyboard input to take no effect. pub fn session_enter_or_leave(_session_id: SessionID, _enter: bool) -> SyncReturn<()> { #[cfg(not(any(target_os = "android", target_os = "ios")))] - if let Some(session) = SESSIONS.read().unwrap().get(&_session_id) { + if let Some(session) = sessions::get_session(&_session_id) { let keyboard_mode = session.get_keyboard_mode(); if _enter { set_cur_session_id_(_session_id, &keyboard_mode); @@ -418,14 +417,14 @@ pub fn session_input_key( shift: bool, command: bool, ) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { // #[cfg(any(target_os = "android", target_os = "ios"))] session.input_key(&name, down, press, alt, ctrl, shift, command); } } pub fn session_input_string(session_id: SessionID, value: String) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { // #[cfg(any(target_os = "android", target_os = "ios"))] session.input_string(&value); } @@ -433,33 +432,33 @@ pub fn session_input_string(session_id: SessionID, value: String) { // chat_client_mode pub fn session_send_chat(session_id: SessionID, text: String) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.send_chat(text); } } pub fn session_peer_option(session_id: SessionID, name: String, value: String) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.set_option(name, value); } } pub fn session_get_peer_option(session_id: SessionID, name: String) -> String { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { return session.get_option(name); } "".to_string() } pub fn session_input_os_password(session_id: SessionID, value: String) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.input_os_password(value, true); } } // File Action pub fn session_read_remote_dir(session_id: SessionID, path: String, include_hidden: bool) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.read_remote_dir(path, include_hidden); } } @@ -473,7 +472,7 @@ pub fn session_send_files( include_hidden: bool, is_remote: bool, ) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.send_files(act_id, path, to, file_num, include_hidden, is_remote); } } @@ -486,7 +485,7 @@ pub fn session_set_confirm_override_file( remember: bool, is_upload: bool, ) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.set_confirm_override_file(act_id, file_num, need_override, remember, is_upload); } } @@ -498,7 +497,7 @@ pub fn session_remove_file( file_num: i32, is_remote: bool, ) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.remove_file(act_id, path, file_num, is_remote); } } @@ -510,7 +509,7 @@ pub fn session_read_dir_recursive( is_remote: bool, show_hidden: bool, ) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.remove_dir_all(act_id, path, is_remote, show_hidden); } } @@ -521,19 +520,19 @@ pub fn session_remove_all_empty_dirs( path: String, is_remote: bool, ) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.remove_dir(act_id, path, is_remote); } } pub fn session_cancel_job(session_id: SessionID, act_id: i32) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.cancel_job(act_id); } } pub fn session_create_dir(session_id: SessionID, act_id: i32, path: String, is_remote: bool) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.create_dir(act_id, path, is_remote); } } @@ -550,14 +549,14 @@ pub fn session_read_local_dir_sync( } pub fn session_get_platform(session_id: SessionID, is_remote: bool) -> String { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { return session.get_platform(is_remote); } "".to_string() } pub fn session_load_last_transfer_jobs(session_id: SessionID) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { return session.load_last_jobs(); } else { // a tip for flutter dev @@ -577,44 +576,44 @@ pub fn session_add_job( include_hidden: bool, is_remote: bool, ) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.add_job(act_id, path, to, file_num, include_hidden, is_remote); } } pub fn session_resume_job(session_id: SessionID, act_id: i32, is_remote: bool) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.resume_job(act_id, is_remote); } } pub fn session_elevate_direct(session_id: SessionID) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.elevate_direct(); } } pub fn session_elevate_with_logon(session_id: SessionID, username: String, password: String) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.elevate_with_logon(username, password); } } pub fn session_switch_sides(session_id: SessionID) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.switch_sides(); } } pub fn session_change_resolution(session_id: SessionID, display: i32, width: i32, height: i32) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.change_resolution(display, width, height); } } pub fn session_set_size(_session_id: SessionID, _width: usize, _height: usize) { #[cfg(feature = "flutter_texture_render")] - if let Some(session) = SESSIONS.write().unwrap().get_mut(&_session_id) { + if let Some(session) = sessions::get_session(&_session_id) { session.set_size(_width, _height); } } @@ -1030,31 +1029,31 @@ pub fn session_add_port_forward( remote_host: String, remote_port: i32, ) { - if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.add_port_forward(local_port, remote_host, remote_port); } } pub fn session_remove_port_forward(session_id: SessionID, local_port: i32) { - if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.remove_port_forward(local_port); } } pub fn session_new_rdp(session_id: SessionID) { - if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.new_rdp(); } } pub fn session_request_voice_call(session_id: SessionID) { - if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.request_voice_call(); } } pub fn session_close_voice_call(session_id: SessionID) { - if let Some(session) = SESSIONS.write().unwrap().get_mut(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.close_voice_call(); } } @@ -1239,20 +1238,20 @@ pub fn session_send_mouse(session_id: SessionID, msg: String) { _ => 0, } << 3; } - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.send_mouse(mask, x, y, alt, ctrl, shift, command); } } } pub fn session_restart_remote_device(session_id: SessionID) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.restart_remote_device(); } } pub fn session_get_audit_server_sync(session_id: SessionID, typ: String) -> SyncReturn { - let res = if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + let res = if let Some(session) = sessions::get_session(&session_id) { session.get_audit_server(typ) } else { "".to_owned() @@ -1261,13 +1260,13 @@ pub fn session_get_audit_server_sync(session_id: SessionID, typ: String) -> Sync } pub fn session_send_note(session_id: SessionID, note: String) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.send_note(note) } } pub fn session_alternative_codecs(session_id: SessionID) -> String { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { let (vp8, av1, h264, h265) = session.alternative_codecs(); let msg = HashMap::from([("vp8", vp8), ("av1", av1), ("h264", h264), ("h265", h265)]); serde_json::ser::to_string(&msg).unwrap_or("".to_owned()) @@ -1277,13 +1276,13 @@ pub fn session_alternative_codecs(session_id: SessionID) -> String { } pub fn session_change_prefer_codec(session_id: SessionID) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.change_prefer_codec(); } } pub fn session_on_waiting_for_image_dialog_show(session_id: SessionID) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { session.ui_handler.on_waiting_for_image_dialog_show(); } } @@ -1523,7 +1522,7 @@ pub fn main_update_me() -> SyncReturn { } pub fn set_cur_session_id(session_id: SessionID) { - if let Some(session) = SESSIONS.read().unwrap().get(&session_id) { + if let Some(session) = sessions::get_session(&session_id) { set_cur_session_id_(session_id, &session.get_keyboard_mode()) } } diff --git a/src/keyboard.rs b/src/keyboard.rs index 72b0ff2f8..5a6c4bace 100644 --- a/src/keyboard.rs +++ b/src/keyboard.rs @@ -1,5 +1,5 @@ #[cfg(feature = "flutter")] -use crate::flutter::{CUR_SESSION_ID, SESSIONS}; +use crate::flutter; #[cfg(target_os = "windows")] use crate::platform::windows::{get_char_from_vk, get_unicode_from_vk}; #[cfg(not(any(feature = "flutter", feature = "cli")))] @@ -220,11 +220,7 @@ fn get_keyboard_mode() -> String { return session.get_keyboard_mode(); } #[cfg(feature = "flutter")] - if let Some(session) = SESSIONS - .read() - .unwrap() - .get(&*CUR_SESSION_ID.read().unwrap()) - { + if let Some(session) = flutter::get_cur_session() { return session.get_keyboard_mode(); } "legacy".to_string() @@ -579,11 +575,7 @@ pub fn send_key_event(key_event: &KeyEvent) { session.send_key_event(key_event); } #[cfg(feature = "flutter")] - if let Some(session) = SESSIONS - .read() - .unwrap() - .get(&*CUR_SESSION_ID.read().unwrap()) - { + if let Some(session) = flutter::get_cur_session() { session.send_key_event(key_event); } } @@ -594,11 +586,7 @@ pub fn get_peer_platform() -> String { return session.peer_platform(); } #[cfg(feature = "flutter")] - if let Some(session) = SESSIONS - .read() - .unwrap() - .get(&*CUR_SESSION_ID.read().unwrap()) - { + if let Some(session) = flutter::get_cur_session() { return session.peer_platform(); } "Windows".to_string() diff --git a/src/plugin/native_handlers/session.rs b/src/plugin/native_handlers/session.rs index 52edd3300..3a3f62f8d 100644 --- a/src/plugin/native_handlers/session.rs +++ b/src/plugin/native_handlers/session.rs @@ -7,12 +7,7 @@ use std::{ use flutter_rust_bridge::StreamSink; -use crate::{ - define_method_prefix, - flutter::FlutterHandler, - flutter_ffi::EventToUI, - ui_session_interface::{ConnectionState, Session}, -}; +use crate::{define_method_prefix, flutter_ffi::EventToUI}; const MSG_TO_UI_TYPE_SESSION_CREATED: &str = "session_created"; @@ -30,7 +25,7 @@ pub type OnSessionRgbaCallback = unsafe extern "C" fn( #[derive(Default)] /// Session related handler for librustdesk core. pub struct PluginNativeSessionHandler { - sessions: Arc>>>, + sessions: Arc>>, cbs: Arc>>, } @@ -63,7 +58,8 @@ impl PluginNativeHandler for PluginNativeSessionHandler { let sessions = SESSION_HANDLER.sessions.read().unwrap(); for session in sessions.iter() { if session.id == id { - let round = session.connection_round_state.lock().unwrap().new_round(); + let round = + session.connection_round_state.lock().unwrap().new_round(); crate::ui_session_interface::io_loop(session.clone(), round); } } diff --git a/src/port_forward.rs b/src/port_forward.rs index 6a087abe2..f71ae2579 100644 --- a/src/port_forward.rs +++ b/src/port_forward.rs @@ -75,7 +75,7 @@ pub async fn listen( let interface = interface.clone(); tokio::spawn(async move { if let Err(err) = run_forward(forward, stream).await { - interface.msgbox("error", "Error", &err.to_string(), ""); + interface.msgbox("error", "Error", &err.to_string(), ""); } log::info!("connection from {:?} closed", addr); }); @@ -121,7 +121,6 @@ async fn connect_and_login( let (mut stream, direct, _pk) = Client::start(id, key, token, conn_type, interface.clone()).await?; interface.update_direct(Some(direct)); - let mut interface = interface; let mut buffer = Vec::new(); let mut received = false; loop { diff --git a/src/ui_session_interface.rs b/src/ui_session_interface.rs index e1923b04a..d932fd112 100644 --- a/src/ui_session_interface.rs +++ b/src/ui_session_interface.rs @@ -1,4 +1,7 @@ use crate::input::{MOUSE_BUTTON_LEFT, MOUSE_TYPE_DOWN, MOUSE_TYPE_UP, MOUSE_TYPE_WHEEL}; +use async_trait::async_trait; +use bytes::Bytes; +use rdev::{Event, EventType::*, KeyCode}; #[cfg(not(any(target_os = "android", target_os = "ios")))] use std::{collections::HashMap, sync::atomic::AtomicBool}; use std::{ @@ -10,10 +13,6 @@ use std::{ }, time::SystemTime, }; - -use async_trait::async_trait; -use bytes::Bytes; -use rdev::{Event, EventType::*, KeyCode}; use uuid::Uuid; #[cfg(not(feature = "flutter"))] @@ -232,7 +231,7 @@ impl Session { } } - pub fn save_keyboard_mode(&mut self, value: String) { + pub fn save_keyboard_mode(&self, value: String) { self.lc.write().unwrap().save_keyboard_mode(value); } @@ -240,19 +239,19 @@ impl Session { self.lc.read().unwrap().reverse_mouse_wheel.clone() } - pub fn save_reverse_mouse_wheel(&mut self, value: String) { + pub fn save_reverse_mouse_wheel(&self, value: String) { self.lc.write().unwrap().save_reverse_mouse_wheel(value); } - pub fn save_view_style(&mut self, value: String) { + pub fn save_view_style(&self, value: String) { self.lc.write().unwrap().save_view_style(value); } - pub fn save_scroll_style(&mut self, value: String) { + pub fn save_scroll_style(&self, value: String) { self.lc.write().unwrap().save_scroll_style(value); } - pub fn save_flutter_option(&mut self, k: String, v: String) { + pub fn save_flutter_option(&self, k: String, v: String) { self.lc.write().unwrap().save_ui_flutter(k, v); } @@ -260,7 +259,7 @@ impl Session { self.lc.read().unwrap().get_ui_flutter(&k) } - pub fn toggle_option(&mut self, name: String) { + pub fn toggle_option(&self, name: String) { let msg = self.lc.write().unwrap().toggle_option(name.clone()); #[cfg(not(feature = "flutter"))] if name == "enable-file-transfer" { @@ -303,7 +302,7 @@ impl Session { self.send(Data::Message(msg)); } - pub fn save_custom_image_quality(&mut self, custom_image_quality: i32) { + pub fn save_custom_image_quality(&self, custom_image_quality: i32) { let msg = self .lc .write() @@ -312,14 +311,14 @@ impl Session { self.send(Data::Message(msg)); } - pub fn save_image_quality(&mut self, value: String) { + pub fn save_image_quality(&self, value: String) { let msg = self.lc.write().unwrap().save_image_quality(value); if let Some(msg) = msg { self.send(Data::Message(msg)); } } - pub fn set_custom_fps(&mut self, custom_fps: i32) { + pub fn set_custom_fps(&self, custom_fps: i32) { let msg = self.lc.write().unwrap().set_custom_fps(custom_fps); self.send(Data::Message(msg)); } @@ -423,7 +422,7 @@ impl Session { self.send(Data::RemovePortForward(port)); } - pub fn add_port_forward(&mut self, port: i32, remote_host: String, remote_port: i32) { + pub fn add_port_forward(&self, port: i32, remote_host: String, remote_port: i32) { let mut config = self.load_config(); if config .port_forwards @@ -901,7 +900,7 @@ impl Session { let cloned = self.clone(); // override only if true if true == force_relay { - cloned.lc.write().unwrap().force_relay = true; + self.lc.write().unwrap().force_relay = true; } let mut lock = self.thread.lock().unwrap(); // No need to join the previous thread, because it will exit automatically. @@ -1216,11 +1215,11 @@ impl Interface for Session { self.ui_handler.msgbox(msgtype, title, text, link, retry); } - fn handle_login_error(&mut self, err: &str) -> bool { + fn handle_login_error(&self, err: &str) -> bool { handle_login_error(self.lc.clone(), err, self) } - fn handle_peer_info(&mut self, mut pi: PeerInfo) { + fn handle_peer_info(&self, mut pi: PeerInfo) { log::debug!("handle_peer_info :{:?}", pi); pi.username = self.lc.read().unwrap().get_username(&pi); if pi.current_display as usize >= pi.displays.len() { @@ -1282,12 +1281,12 @@ impl Interface for Session { } } - async fn handle_hash(&mut self, pass: &str, hash: Hash, peer: &mut Stream) { + async fn handle_hash(&self, pass: &str, hash: Hash, peer: &mut Stream) { handle_hash(self.lc.clone(), pass, hash, self, peer).await; } async fn handle_login_from_ui( - &mut self, + &self, os_username: String, os_password: String, password: String, @@ -1305,7 +1304,7 @@ impl Interface for Session { .await; } - async fn handle_test_delay(&mut self, t: TestDelay, peer: &mut Stream) { + async fn handle_test_delay(&self, t: TestDelay, peer: &mut Stream) { if !t.from_client { self.update_quality_status(QualityStatus { delay: Some(t.last_delay as _), From 8b807d7b5048ce9f94c923e54f92ffe18c9044af Mon Sep 17 00:00:00 2001 From: fufesou Date: Tue, 3 Oct 2023 21:16:12 +0800 Subject: [PATCH 59/71] fix, cursor (hotx,hoty) mismatch sometimes Signed-off-by: fufesou --- flutter/lib/desktop/pages/remote_page.dart | 2 +- flutter/lib/models/model.dart | 73 +++++++++++++--------- 2 files changed, 46 insertions(+), 29 deletions(-) diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index 13271378d..fee5bd8f4 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -614,7 +614,7 @@ class _ImagePaintState extends State { } else { final key = cache.updateGetKey(scale); if (!cursor.cachedKeys.contains(key)) { - debugPrint("Register custom cursor with key $key"); + debugPrint("Register custom cursor with key $key (${cache.hotx},${cache.hoty})"); // [Safety] // It's ok to call async registerCursor in current synchronous context, // because activating the cursor is also an async call and will always diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index a7082eb4b..d8ef19e08 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -1279,6 +1279,7 @@ class CursorModel with ChangeNotifier { final _cacheKeys = {}; double _x = -10000; double _y = -10000; + int _id = -1; double _hotx = 0; double _hoty = 0; double _displayOriginX = 0; @@ -1287,7 +1288,7 @@ class CursorModel with ChangeNotifier { bool gotMouseControl = true; DateTime _lastPeerMouse = DateTime.now() .subtract(Duration(milliseconds: 3000 * kMouseControlTimeoutMSec)); - String id = ''; + String peerId = ''; WeakReference parent; ui.Image? get image => _image; @@ -1439,32 +1440,35 @@ class CursorModel with ChangeNotifier { } updateCursorData(Map evt) async { - var id = int.parse(evt['id']); - _hotx = double.parse(evt['hotx']); - _hoty = double.parse(evt['hoty']); - var width = int.parse(evt['width']); - var height = int.parse(evt['height']); + final id = int.parse(evt['id']); + // Update last cursor id. + _id = id; + final hotx = double.parse(evt['hotx']); + final hoty = double.parse(evt['hoty']); + final width = int.parse(evt['width']); + final height = int.parse(evt['height']); List colors = json.decode(evt['colors']); final rgba = Uint8List.fromList(colors.map((s) => s as int).toList()); final image = await img.decodeImageFromPixels( rgba, width, height, ui.PixelFormat.rgba8888); - _image = image; - if (await _updateCache(rgba, image, id, width, height)) { - _images[id] = Tuple3(image, _hotx, _hoty); - } else { - _hotx = 0; - _hoty = 0; - } - try { - // my throw exception, because the listener maybe already dispose - notifyListeners(); - } catch (e) { - debugPrint('WARNING: updateCursorId $id, without notifyListeners(). $e'); + if (await _updateCache(rgba, image, id, hotx, hoty, width, height)) { + _images[id] = Tuple3(image, hotx, hoty); } + + // Update last cursor data. + // Do not use the previous `image` and `id`, because `_id` may be changed. + _updateCursorIdData(_id); } Future _updateCache( - Uint8List rgba, ui.Image image, int id, int w, int h) async { + Uint8List rgba, + ui.Image image, + int id, + double hotx, + double hoty, + int w, + int h, + ) async { Uint8List? data; img2.Image imgOrigin = img2.Image.fromBytes( width: w, height: h, bytes: rgba.buffer, order: img2.ChannelOrder.rgba); @@ -1478,31 +1482,44 @@ class CursorModel with ChangeNotifier { } data = imgBytes.buffer.asUint8List(); } - _cache = CursorData( - peerId: this.id, + final cache = CursorData( + peerId: peerId, id: id, image: imgOrigin, scale: 1.0, data: data, - hotxOrigin: _hotx, - hotyOrigin: _hoty, + hotxOrigin: hotx, + hotyOrigin: hoty, width: w, height: h, ); - _cacheMap[id] = _cache!; + _cacheMap[id] = cache; return true; } - updateCursorId(Map evt) async { - final id = int.parse(evt['id']); + bool _updateCursorIdData(int id) { _cache = _cacheMap[id]; final tmp = _images[id]; if (tmp != null) { _image = tmp.item1; _hotx = tmp.item2; _hoty = tmp.item3; - notifyListeners(); + try { + // may throw exception, because the listener maybe already dispose + notifyListeners(); + } catch (e) { + debugPrint( + 'WARNING: updateCursorId $id, without notifyListeners(). $e'); + } + return true; } else { + return false; + } + } + + updateCursorId(Map evt) async { + final id = int.parse(evt['id']); + if (!_updateCursorIdData(id)) { debugPrint( 'WARNING: updateCursorId $id, cache is ${_cache == null ? "null" : "not null"}. without notifyListeners()'); } @@ -1748,7 +1765,7 @@ class FFI { connType = ConnType.defaultConn; canvasModel.id = id; imageModel.id = id; - cursorModel.id = id; + cursorModel.peerId = id; } // If tabWindowId != null, this session is a "tab -> window" one. // Else this session is a new one. From 197a9330df3a5297a8b0ad634026443534883b10 Mon Sep 17 00:00:00 2001 From: fufesou Date: Tue, 3 Oct 2023 21:18:53 +0800 Subject: [PATCH 60/71] fix, cursor hotxy, use _id Signed-off-by: fufesou --- flutter/lib/models/model.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index d8ef19e08..7bdfa9b3d 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -1457,7 +1457,7 @@ class CursorModel with ChangeNotifier { // Update last cursor data. // Do not use the previous `image` and `id`, because `_id` may be changed. - _updateCursorIdData(_id); + _updateCurData(); } Future _updateCache( @@ -1497,9 +1497,9 @@ class CursorModel with ChangeNotifier { return true; } - bool _updateCursorIdData(int id) { - _cache = _cacheMap[id]; - final tmp = _images[id]; + bool _updateCurData() { + _cache = _cacheMap[_id]; + final tmp = _images[_id]; if (tmp != null) { _image = tmp.item1; _hotx = tmp.item2; @@ -1509,7 +1509,7 @@ class CursorModel with ChangeNotifier { notifyListeners(); } catch (e) { debugPrint( - 'WARNING: updateCursorId $id, without notifyListeners(). $e'); + 'WARNING: updateCursorId $_id, without notifyListeners(). $e'); } return true; } else { @@ -1518,10 +1518,10 @@ class CursorModel with ChangeNotifier { } updateCursorId(Map evt) async { - final id = int.parse(evt['id']); - if (!_updateCursorIdData(id)) { + _id = int.parse(evt['id']); + if (!_updateCurData()) { debugPrint( - 'WARNING: updateCursorId $id, cache is ${_cache == null ? "null" : "not null"}. without notifyListeners()'); + 'WARNING: updateCursorId $_id, cache is ${_cache == null ? "null" : "not null"}. without notifyListeners()'); } } From 5d6d8e68ed9b2517b3198a482dfef485cb85b205 Mon Sep 17 00:00:00 2001 From: fufesou Date: Tue, 3 Oct 2023 22:15:58 +0800 Subject: [PATCH 61/71] Update cursor id immediately after the cursor event Signed-off-by: fufesou --- flutter/lib/models/model.dart | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index 7bdfa9b3d..3c42e02a3 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -203,10 +203,12 @@ class FfiModel with ChangeNotifier { updatePrivacyMode(data.updatePrivacyMode, sessionId, peerId); setConnectionType(peerId, data.secure, data.direct); await handlePeerInfo(data.peerInfo, peerId); - for (var element in data.cursorDataList) { + for (final element in data.cursorDataList) { + updateLastCursorId(element); await handleCursorData(element); } - await handleCursorId(data.lastCursorId); + updateLastCursorId(data.lastCursorId); + handleCursorId(data.lastCursorId); } // todo: why called by two position @@ -225,9 +227,11 @@ class FfiModel with ChangeNotifier { } else if (name == 'switch_display') { handleSwitchDisplay(evt, sessionId, peerId); } else if (name == 'cursor_data') { + updateLastCursorId(evt); await handleCursorData(evt); } else if (name == 'cursor_id') { - await handleCursorId(evt); + updateLastCursorId(evt); + handleCursorId(evt); } else if (name == 'cursor_position') { await parent.target?.cursorModel.updateCursorPosition(evt, peerId); } else if (name == 'clipboard') { @@ -651,9 +655,13 @@ class FfiModel with ChangeNotifier { return d; } - handleCursorId(Map evt) async { + updateLastCursorId(Map evt) { + parent.target?.cursorModel.id = int.parse(evt['id']); + } + + handleCursorId(Map evt) { cachedPeerData.lastCursorId = evt; - await parent.target?.cursorModel.updateCursorId(evt); + parent.target?.cursorModel.updateCursorId(evt); } handleCursorData(Map evt) async { @@ -1302,6 +1310,8 @@ class CursorModel with ChangeNotifier { double get hotx => _hotx; double get hoty => _hoty; + set id(int id) => _id = id; + bool get isPeerControlProtected => DateTime.now().difference(_lastPeerMouse).inMilliseconds < kMouseControlTimeoutMSec; @@ -1441,8 +1451,6 @@ class CursorModel with ChangeNotifier { updateCursorData(Map evt) async { final id = int.parse(evt['id']); - // Update last cursor id. - _id = id; final hotx = double.parse(evt['hotx']); final hoty = double.parse(evt['hoty']); final width = int.parse(evt['width']); @@ -1517,8 +1525,7 @@ class CursorModel with ChangeNotifier { } } - updateCursorId(Map evt) async { - _id = int.parse(evt['id']); + updateCursorId(Map evt) { if (!_updateCurData()) { debugPrint( 'WARNING: updateCursorId $_id, cache is ${_cache == null ? "null" : "not null"}. without notifyListeners()'); From aec7271f50a309f68ef79805b2d2ecade1ddc66c Mon Sep 17 00:00:00 2001 From: Kleofass Date: Wed, 4 Oct 2023 15:07:57 +0300 Subject: [PATCH 62/71] Update lv.rs --- src/lang/lv.rs | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/lang/lv.rs b/src/lang/lv.rs index b1abd922b..03480f54e 100644 --- a/src/lang/lv.rs +++ b/src/lang/lv.rs @@ -21,7 +21,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Confirmation", "Apstiprinājums"), ("TCP Tunneling", "TCP tunelēšana"), ("Remove", "Noņemt"), - ("Refresh random password", "Atsvaidzināt nejaušu paroli"), + ("Refresh random password", "Atsvaidzināt nejaušo paroli"), ("Set your own password", "Iestatiet savu paroli"), ("Enable Keyboard/Mouse", "Iespējot tastatūru/peli"), ("Enable Clipboard", "Iespējot starpliktuvi"), @@ -151,8 +151,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Click to download", "Lejupielādēt"), ("Click to update", "Atjaunināt"), ("Configure", "Konfigurēt"), - ("config_acc", "Lai attālināti vadītu savu darbvirsmu, jums ir jāpiešķir RustDesk \"Accessibility\" atļaujas."), - ("config_screen", "Lai attālināti piekļūtu darbvirsmai, jums ir jāpiešķir RustDesk \"Screen Recording\" atļaujas."), + ("config_acc", "Lai attālināti vadītu savu darbvirsmu, jums ir jāpiešķir RustDesk \"Pieejamība\" atļaujas."), + ("config_screen", "Lai attālināti piekļūtu darbvirsmai, jums ir jāpiešķir RustDesk \"Ekrāna tveršana\" atļaujas."), ("Installing ...", "Notiek instalēšana..."), ("Install", "Uzstādīt"), ("Installation", "Instalēšana"), @@ -219,7 +219,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("whitelist_tip", "Man var piekļūt tikai baltajā sarakstā iekļautās IP adreses"), ("Login", "Pieslēgties"), ("Verify", "Pārbaudīt"), - ("Remember me", "Atceries mani"), + ("Remember me", "Atcerēties mani"), ("Trust this device", "Uzticēties šai ierīcei"), ("Verification code", "Verifikācijas kods"), ("verification_tip", "Verifikācijas kods ir nosūtīts uz reģistrēto e-pasta adresi, ievadiet verifikācijas kodu, lai turpinātu pieslēgšanos."), @@ -245,7 +245,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Socks5 Proxy", "Socks5 starpniekserveris"), ("Hostname", "Resursdatora nosaukums"), ("Discovered", "Atklāts"), - ("install_daemon_tip", "Lai startētu sāknēšanu, ir jāinstalē sistēmas serviss."), + ("install_daemon_tip", "Lai palaistu pie startēšanas, ir jāinstalē sistēmas serviss."), ("Remote ID", "Attālais ID"), ("Paste", "Ielīmēt"), ("Paste here?", "Ielīmēt šeit?"), @@ -284,13 +284,13 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Do you accept?", "Vai Jūs pieņemat?"), ("Open System Setting", "Atvērt sistēmas iestatījumus"), ("How to get Android input permission?", "Kā iegūt Android ievades atļauju?"), - ("android_input_permission_tip1", "Lai attālā ierīce varētu vadīt jūsu Android ierīci, izmantojot peli vai pieskārienu, jums ir jāatļauj RustDesk izmantot servisu \"Accessibility\"."), - ("android_input_permission_tip2", "Lūdzu, dodieties uz nākamo sistēmas iestatījumu lapu, atrodiet un ievadiet [Installed Services], ieslēdziet servisu [RustDesk Input]."), + ("android_input_permission_tip1", "Lai attālā ierīce varētu vadīt jūsu Android ierīci, izmantojot peli vai pieskārienu, jums ir jāatļauj RustDesk izmantot servisu \"Pieejamība\"."), + ("android_input_permission_tip2", "Lūdzu, dodieties uz nākamo sistēmas iestatījumu lapu, atrodiet un atveriet [Instalētie pakalpojumi], ieslēdziet servisu [RustDesk Input]."), ("android_new_connection_tip", "Ir saņemts jauns vadības pieprasījums, kas vēlas kontrolēt jūsu pašreizējo ierīci."), - ("android_service_will_start_tip", "Ieslēdzot \"Screen Capture\", serviss tiks automātiski startēts, ļaujot citām ierīcēm pieprasīt savienojumu ar jūsu ierīci."), + ("android_service_will_start_tip", "Ieslēdzot \"Ekrāna tveršana\", serviss tiks automātiski startēts, ļaujot citām ierīcēm pieprasīt savienojumu ar jūsu ierīci."), ("android_stop_service_tip", "Pakalpojuma aizvēršana automātiski aizvērs visus izveidotos savienojumus."), ("android_version_audio_tip", "Pašreizējā Android versija neatbalsta audio uztveršanu, lūdzu, jauniniet uz Android 10 vai jaunāku versiju."), - ("android_start_service_tip", "Pieskarieties [Start Service] vai iespējojiet [Screen Capture] atļauju, lai sāktu ekrāna koplietošanas servisu."), + ("android_start_service_tip", "Pieskarieties [Sākt servisu] vai iespējojiet [Ekrāna tveršana] atļauju, lai sāktu ekrāna koplietošanas servisu."), ("android_permission_may_not_change_tip", "Izveidoto savienojumu atļaujas nevar mainīt uzreiz, kamēr nav atkārtoti izveidots savienojums."), ("Account", "Konts"), ("Overwrite", "Pārrakstīt"), @@ -305,7 +305,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Unsupported", "Neatbalstīts"), ("Peer denied", "Sesija noraidīta"), ("Please install plugins", "Lūdzu, instalējiet spraudņus"), - ("Peer exit", "Vienādranga izeja"), + ("Peer exit", "Iziet no attālās ierīces"), ("Failed to turn off", "Neizdevās izslēgt"), ("Turned off", "Izslēgts"), ("In privacy mode", "Privātuma režīmā"), @@ -313,9 +313,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Language", "Valoda"), ("Keep RustDesk background service", "Saglabāt RustDesk fona servisu"), ("Ignore Battery Optimizations", "Ignorēt akumulatora optimizāciju"), - ("android_open_battery_optimizations_tip", "Ja vēlaties atspējot šo funkciju, lūdzu, dodieties uz nākamo RustDesk lietojumprogrammas iestatījumu lapu, atrodiet un ievadiet [Battery], noņemiet atzīmi no [Unrestricted]"), - ("Start on Boot", "Sāciet ar sāknēšanu"), - ("Start the screen sharing service on boot, requires special permissions", "Startējiet ekrāna koplietošanas pakalpojumu sāknēšanas laikā, nepieciešamas īpašas atļaujas"), + ("android_open_battery_optimizations_tip", "Ja vēlaties atspējot šo funkciju, lūdzu, dodieties uz nākamo RustDesk lietojumprogrammas iestatījumu lapu, atrodiet un atveriet [Akumulators], noņemiet atzīmi no [Neierobežots]"), + ("Start on Boot", "Palaist pie ieslēgšanas"), + ("Start the screen sharing service on boot, requires special permissions", "Startējiet ekrāna koplietošanas pakalpojumu ieslēgšanas laikā, nepieciešamas īpašas atļaujas"), ("Connection not allowed", "Savienojums nav atļauts"), ("Legacy mode", "Novecojis režīms"), ("Map mode", "Kartēšanas režīms"), @@ -366,7 +366,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Disconnect all devices?", "Atvienot visas ierīces?"), ("Clear", "Notīrīt"), ("Audio Input Device", "Audio ievades ierīce"), - ("Use IP Whitelisting", "Izmantot IP balto sarakstu"), + ("Use IP Whitelisting", "Izmantot balto IP sarakstu"), ("Network", "Tīkls"), ("Enable RDP", "Iespējot RDP"), ("Pin Toolbar", "Piespraust rīkjoslu"), @@ -405,9 +405,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Accept sessions via click", "Pieņemt sesijas, noklikšķinot"), ("Accept sessions via both", "Pieņemt sesijas, izmantojot abus"), ("Please wait for the remote side to accept your session request...", "Lūdzu, uzgaidiet, kamēr attālā puse pieņems jūsu sesijas pieprasījumu..."), - ("One-time Password", "Vienreizēja parole"), + ("One-time Password", "Vienreizējā parole"), ("Use one-time password", "Izmantot vienreizējo paroli"), - ("One-time password length", "Vienreizējas paroles garums"), + ("One-time password length", "Vienreizējās paroles garums"), ("Request access to your device", "Pieprasīt piekļuvi savai ierīcei"), ("Hide connection management window", "Slēpt savienojuma pārvaldības logu"), ("hide_cm_tip", "Atļaut paslēpšanu tikai tad, ja akceptējat sesijas, izmantojot paroli un pastāvīgo paroli"), @@ -422,8 +422,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Select local keyboard type", "Izvēlēties vietējās tastatūras veidu"), ("software_render_tip", "Ja izmantojat Nvidia grafikas karti operētājsistēmā Linux un attālais logs tiek aizvērts uzreiz pēc savienojuma izveides, var palīdzēt pārslēgšanās uz atvērtā koda Nouveau draiveri un izvēle izmantot programmatūras renderēšanu. Nepieciešama programmatūras restartēšana."), ("Always use software rendering", "Vienmēr izmantot programmatūras renderēšanu"), - ("config_input", "Lai vadītu attālo darbvirsmu ar tastatūru, jums ir jāpiešķir RustDesk \"Input Monitoring\" atļaujas."), - ("config_microphone", "Lai runātu attālināti, jums ir jāpiešķir RustDesk \"Record Audio\" atļaujas."), + ("config_input", "Lai vadītu attālo darbvirsmu ar tastatūru, jums ir jāpiešķir RustDesk \"Ievades uzraudzība\" atļaujas."), + ("config_microphone", "Lai runātu attālināti, jums ir jāpiešķir RustDesk \"Ierakstīt audio\" atļaujas."), ("request_elevation_tip", "Paaugstinājumu var pieprasīt arī tad, ja attālajā pusē ir kāds cilvēks."), ("Wait", "Pagaidiet"), ("Elevation Error", "Paaugstinājuma kļūda"), @@ -461,7 +461,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Codec", "Kodeks"), ("Resolution", "Izšķirtspēja"), ("No transfers in progress", "Notiek pārsūtīšana"), - ("Set one-time password length", "Iestatīt vienreizējas paroles garumu"), + ("Set one-time password length", "Iestatīt vienreizējās paroles garumu"), ("install_cert_tip", "Instalēt RustDesk sertifikātu"), ("confirm_install_cert_tip", "Šis ir RustDesk testēšanas sertifikāts, kuram var uzticēties. Sertifikāts tiks izmantots, lai uzticētos un vajadzības gadījumā instalētu RustDesk draiverus."), ("RDP Settings", "RDP iestatījumi"), From c0ed44abf95610ec90da136c04c141250f04fcad Mon Sep 17 00:00:00 2001 From: "Phongsathorn Sae-Ung (X10)" Date: Thu, 5 Oct 2023 18:19:35 +0700 Subject: [PATCH 63/71] fix: add new words and update existing words to up-to-date --- src/lang/th.rs | 356 ++++++++++++++++++++++++------------------------- 1 file changed, 178 insertions(+), 178 deletions(-) diff --git a/src/lang/th.rs b/src/lang/th.rs index 2629540d2..c3726a5bb 100644 --- a/src/lang/th.rs +++ b/src/lang/th.rs @@ -37,23 +37,23 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Clipboard is empty", "คลิปบอร์ดว่างเปล่า"), ("Stop service", "หยุดการใช้งานเซอร์วิส"), ("Change ID", "เปลี่ยน ID"), - ("Your new ID", ""), - ("length %min% to %max%", ""), - ("starts with a letter", ""), - ("allowed characters", ""), + ("Your new ID", "ID ใหม่ของคุณ"), + ("length %min% to %max%", "ความยาวตั้งแต่ %min% ถึง %max%"), + ("starts with a letter", "เริ่มต้นด้วยตัวอักษร"), + ("allowed characters", "ตัวอักขระที่อนุญาต"), ("id_change_tip", "อนุญาตเฉพาะตัวอักษร a-z A-Z 0-9 และ _ (ขีดล่าง) เท่านั้น โดยตัวอักษรขึ้นต้นจะต้องเป็น a-z หรือไม่ก็ A-Z และมีความยาวระหว่าง 6 ถึง 16 ตัวอักษร"), ("Website", "เว็บไซต์"), ("About", "เกี่ยวกับ"), - ("Slogan_tip", "ทำด้วยใจ ในโลกใบนี้ที่ยุ่งเหยิง!"), + ("Slogan_tip", "ทำด้วยใจ ในโลกที่วุ่นวาย!"), ("Privacy Statement", "คำแถลงเกี่ยวกับความเป็นส่วนตัว"), ("Mute", "ปิดเสียง"), - ("Build Date", ""), - ("Version", ""), - ("Home", ""), + ("Build Date", "วันที่ Build"), + ("Version", "เวอร์ชัน"), + ("Home", "หน้าหลัก"), ("Audio Input", "ออดิโออินพุท"), ("Enhancements", "การปรับปรุง"), - ("Hardware Codec", "ฮาร์ดแวร์ codec"), - ("Adaptive bitrate", "บิทเรทผันแปร"), + ("Hardware Codec", "ฮาร์ดแวร์ Codec"), + ("Adaptive bitrate", "Bitrate ผันแปร"), ("ID Server", "เซิร์ฟเวอร์ ID"), ("Relay Server", "เซิร์ฟเวอร์ Relay"), ("API Server", "เซิร์ฟเวอร์ API"), @@ -139,9 +139,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Remote desktop is offline", "เดสก์ท็อปปลายทางออฟไลน์"), ("Key mismatch", "คีย์ไม่ถูกต้อง"), ("Timeout", "หมดเวลา"), - ("Failed to connect to relay server", "การเชื่อมต่อไปยังเซิร์ฟเวอร์รีเลย์ล้มเหลว"), + ("Failed to connect to relay server", "การเชื่อมต่อไปยังเซิร์ฟเวอร์ Relay ล้มเหลว"), ("Failed to connect via rendezvous server", "การเชื่อมต่อผ่านเซิร์ฟเวอร์นัดพบล้มเหลว"), - ("Failed to connect via relay server", "การเชื่อมต่อผ่านเซิร์ฟเวอร์รีเลย์ล้มเหลว"), + ("Failed to connect via relay server", "การเชื่อมต่อผ่านเซิร์ฟเวอร์ Relay ล้มเหลว"), ("Failed to make direct connection to remote desktop", "การเชื่อมต่อตรงไปยังเดสก์ท็อปปลายทางล้มเหลว"), ("Set Password", "ตั้งรหัสผ่าน"), ("OS Password", "รหัสผ่านระบบปฏิบัติการ"), @@ -162,7 +162,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Accept and Install", "ยอมรับและติดตั้ง"), ("End-user license agreement", "ข้อตกลงใบอนุญาตผู้ใช้งาน"), ("Generating ...", "กำลังสร้าง ..."), - ("Your installation is lower version.", "การติดตั้งของคุณเป็นเวอร์ชั่นที่ต่ำกว่า"), + ("Your installation is lower version.", "การติดตั้งของคุณเป็นเวอร์ชันที่ต่ำกว่า"), ("not_close_tcp_tip", "อย่าปิดหน้าต่างนี้ในขณะที่คุณกำลังใช้งานอุโมงค์การเชื่อมต่อ"), ("Listening ...", "กำลังรอรับข้อมูล ..."), ("Remote Host", "โฮสต์ปลายทาง"), @@ -185,9 +185,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Allow file copy and paste", "อนุญาตให้มีการคัดลอกและวางไฟล์"), ("Connected", "เชื่อมต่อแล้ว"), ("Direct and encrypted connection", "การเชื่อมต่อตรงที่มีการเข้ารหัส"), - ("Relayed and encrypted connection", "การเชื่อมต่อแบบรีเลย์ที่มีการเข้ารหัส"), + ("Relayed and encrypted connection", "การเชื่อมต่อแบบ Relay ที่มีการเข้ารหัส"), ("Direct and unencrypted connection", "การเชื่อมต่อตรงที่ไม่มีการเข้ารหัส"), - ("Relayed and unencrypted connection", "การเชื่อมต่อแบบรีเลย์ที่ไม่มีการเข้ารหัส"), + ("Relayed and unencrypted connection", "การเชื่อมต่อแบบ Relay ที่ไม่มีการเข้ารหัส"), ("Enter Remote ID", "กรอก ID ปลายทาง"), ("Enter your password", "กรอกรหัสผ่าน"), ("Logging in...", "กำลังเข้าสู่ระบบ..."), @@ -210,18 +210,18 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Settings", "ตั้งค่า"), ("Username", "ชื่อผู้ใช้งาน"), ("Invalid port", "พอร์ทไม่ถูกต้อง"), - ("Closed manually by the peer", "ถูกปิดโดยอีกฝั่งการการเชื่อมต่อ"), + ("Closed manually by the peer", "ถูกปิดโดยอีกฝั่งของการเชื่อมต่อ"), ("Enable remote configuration modification", "เปิดการใช้งานการแก้ไขการตั้งค่าปลายทาง"), ("Run without install", "ใช้งานโดยไม่ต้องติดตั้ง"), - ("Connect via relay", ""), - ("Always connect via relay", "เชื่อมต่อผ่านรีเลย์เสมอ"), + ("Connect via relay", "เชื่อมต่อผ่าน Relay"), + ("Always connect via relay", "เชื่อมต่อผ่าน Relay เสมอ"), ("whitelist_tip", "อนุญาตเฉพาะการเชื่อมต่อจาก IP ที่ไวท์ลิสต์"), ("Login", "เข้าสู่ระบบ"), - ("Verify", ""), - ("Remember me", ""), - ("Trust this device", ""), - ("Verification code", ""), - ("verification_tip", ""), + ("Verify", "ยืนยันความถูกต้อง"), + ("Remember me", "จดจำฉัน"), + ("Trust this device", "เชื่อถืออุปกรณ์นี้"), + ("Verification code", "รหัสยืนยันความถูกต้อง"), + ("verification_tip", "รหัสยืนยันความถูกต้องได้ถูกส่งไปยังอีเมล์ที่ลงทะเบียนแล้ว กรุณากรอกรหัสยืนยันความถูกต้องเพื่อดำเนินการเข้าสู่ระบบต่อ"), ("Logout", "ออกจากระบบ"), ("Tags", "แท็ก"), ("Search ID", "ค้นหา ID"), @@ -233,7 +233,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Username missed", "ไม่พบข้อมูลผู้ใช้งาน"), ("Password missed", "ไม่พบรหัสผ่าน"), ("Wrong credentials", "ข้อมูลสำหรับเข้าสู่ระบบไม่ถูกต้อง"), - ("The verification code is incorrect or has expired", ""), + ("The verification code is incorrect or has expired", "รหัสยืนยันไม่ถูกต้องหรือหมดอายุแล้ว"), ("Edit Tag", "แก้ไขแท็ก"), ("Forget Password", "ยกเลิกการจดจำรหัสผ่าน"), ("Favorites", "รายการโปรด"), @@ -249,7 +249,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Paste", "วาง"), ("Paste here?", "วางที่นี่หรือไม่?"), ("Are you sure to close the connection?", "คุณแน่ใจหรือไม่ที่จะปิดการเชื่อมต่อ?"), - ("Download new version", "ดาวน์โหลดเวอร์ชั่นใหม่"), + ("Download new version", "ดาวน์โหลดเวอร์ชันใหม่"), ("Touch mode", "โหมดการสัมผัส"), ("Mouse mode", "โหมดการใช้เมาส์"), ("One-Finger Tap", "แตะนิ้วเดียว"), @@ -275,9 +275,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Total", "รวม"), ("items", "รายการ"), ("Selected", "ถูกเลือก"), - ("Screen Capture", "แคปเจอร์หน้าจอ"), + ("Screen Capture", "บันทึกหน้าจอ"), ("Input Control", "ควบคุมอินพุท"), - ("Audio Capture", "แคปเจอร์เสียง"), + ("Audio Capture", "บันทึกเสียง"), ("File Connection", "การเชื่อมต่อไฟล์"), ("Screen Connection", "การเชื่อมต่อหน้าจอ"), ("Do you accept?", "ยอมรับหรือไม่?"), @@ -288,9 +288,9 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("android_new_connection_tip", "ได้รับคำขอควบคุมใหม่ที่ต้องการควบคุมอุปกรณ์ของคุณ"), ("android_service_will_start_tip", "การเปิดการใช้งาน \"การบันทึกหน้าจอ\" จะเป็นการเริ่มต้นการทำงานของเซอร์วิสโดยอัตโนมัติ ที่จะอนุญาตให้อุปกรณ์อื่นๆ ส่งคำขอเข้าถึงมายังอุปกรณ์ของคุณได้"), ("android_stop_service_tip", "การปิดการใช้งานเซอร์วิสจะปิดการเชื่อมต่อทั้งหมดโดยอัตโนมัติ"), - ("android_version_audio_tip", "เวอร์ชั่นแอนดรอยด์ปัจจุบันของคุณไม่รองรับการบันทึกข้อมูลเสียง กรุณาอัปเกรดเป็นแอนดรอยด์เวอร์ชั่น 10 หรือสูงกว่า"), - ("android_start_service_tip", ""), - ("android_permission_may_not_change_tip", ""), + ("android_version_audio_tip", "เวอร์ชันแอนดรอยด์ปัจจุบันของคุณไม่รองรับการบันทึกข้อมูลเสียง กรุณาอัปเกรดเป็นแอนดรอยด์เวอร์ชัน 10 หรือสูงกว่า"), + ("android_start_service_tip", "แตะ [เริ่มต้นใช้งานเซอร์วิส] หรือเปิดสิทธิ์การใช้งาน [บันทึกหน้าจอ] เพื่อเริ่มต้นใช้งานเซอร์วิสสำหรับการแบ่งปันหน้าจอ"), + ("android_permission_may_not_change_tip", "สิทธิ์การใช้งานสำหรับการเชื่อมต่อที่กำลังเปิดใช้งานอยู่อาจจะไม่ได้เปลี่ยนแปลงในทันทีจนกว่าจะเริ่มต้นการเชื่อมต่อใหม่อีกครั้ง"), ("Account", "บัญชี"), ("Overwrite", "เขียนทับ"), ("This file exists, skip or overwrite this file?", "พบไฟล์ที่มีอยู่แล้ว ต้องการเขียนทับหรือไม่?"), @@ -312,12 +312,12 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Keep RustDesk background service", "คงสถานะการทำงานเบื้องหลังของเซอร์วิส RustDesk"), ("Ignore Battery Optimizations", "เพิกเฉยการตั้งค่าการใช้งาน Battery Optimization"), ("android_open_battery_optimizations_tip", "หากคุณต้องการปิดการใช้งานฟีเจอร์นี้ กรุณาไปยังหน้าตั้งค่าในแอปพลิเคชัน RustDesk ค้นหาหัวข้อ [Battery] และยกเลิกการเลือกรายการ [Unrestricted]"), - ("Start on Boot", ""), - ("Start the screen sharing service on boot, requires special permissions", ""), + ("Start on Boot", "เริ่มต้นเมื่อเปิดเครื่อง"), + ("Start the screen sharing service on boot, requires special permissions", "เริ่มต้นใช้งานเซอร์วิสสำหรับการแบ่งปันหน้าจอเมื่อเปิดเครื่อง (ต้องมีการให้สิทธิ์การใช้งานพิเศษเพิ่มเติม)"), ("Connection not allowed", "การเชื่อมต่อไม่อนุญาต"), - ("Legacy mode", ""), - ("Map mode", ""), - ("Translate mode", ""), + ("Legacy mode", "โหมดดั้งเดิม"), + ("Map mode", "โหมดการจับคู่"), + ("Translate mode", "โหมดแปลงค่า"), ("Use permanent password", "ใช้รหัสผ่านถาวร"), ("Use both passwords", "ใช้รหัสผ่านทั้งสองแบบ"), ("Set permanent password", "ตั้งค่ารหัสผ่านถาวร"), @@ -337,10 +337,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Ratio", "อัตราส่วน"), ("Image Quality", "คุณภาพภาพ"), ("Scroll Style", "ลักษณะการเลื่อน"), - ("Show Toolbar", ""), - ("Hide Toolbar", ""), + ("Show Toolbar", "แสดงแถบเครื่องมือ"), + ("Hide Toolbar", "ซ่อนแถบเครื่องมือ"), ("Direct Connection", "การเชื่อมต่อตรง"), - ("Relay Connection", "การเชื่อมต่อแบบรีเลย์"), + ("Relay Connection", "การเชื่อมต่อแบบ Relay "), ("Secure Connection", "การเชื่อมต่อที่ปลอดภัย"), ("Insecure Connection", "การเชื่อมต่อที่ไม่ปลอดภัย"), ("Scale original", "ขนาดเดิม"), @@ -349,7 +349,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Security", "ความปลอดภัย"), ("Theme", "ธีม"), ("Dark Theme", "ธีมมืด"), - ("Light Theme", ""), + ("Light Theme", "ธีมสว่าง"), ("Dark", "มืด"), ("Light", "สว่าง"), ("Follow System", "ตามระบบ"), @@ -367,8 +367,8 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Use IP Whitelisting", "ใช้งาน IP ไวท์ลิสต์"), ("Network", "เครือข่าย"), ("Enable RDP", "เปิดการใช้งาน RDP"), - ("Pin Toolbar", ""), - ("Unpin Toolbar", ""), + ("Pin Toolbar", "ปักหมุดแถบเครื่องมือ"), + ("Unpin Toolbar", "ยกเลิกการปักหมุดแถบเครื่องมือ"), ("Recording", "การบันทึก"), ("Directory", "ไดเรกทอรี่"), ("Automatically record incoming sessions", "บันทึกเซสชันขาเข้าโดยอัตโนมัติ"), @@ -389,12 +389,12 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Keyboard Settings", "การตั้งค่าคีย์บอร์ด"), ("Full Access", "การเข้าถึงทั้งหมด"), ("Screen Share", "การแชร์จอ"), - ("Wayland requires Ubuntu 21.04 or higher version.", "Wayland ต้องการ Ubuntu เวอร์ชั่น 21.04 หรือสูงกว่า"), + ("Wayland requires Ubuntu 21.04 or higher version.", "Wayland ต้องการ Ubuntu เวอร์ชัน 21.04 หรือสูงกว่า"), ("Wayland requires higher version of linux distro. Please try X11 desktop or change your OS.", "Wayland ต้องการลินุกซ์เวอร์ชันที่สูงกว่านี้ กรุณาเปลี่ยนไปใช้เดสก์ท็อป X11 หรือเปลี่ยนระบบปฏิบัติการของคุณ"), ("JumpLink", "View"), ("Please Select the screen to be shared(Operate on the peer side).", "กรุณาเลือกหน้าจอที่ต้องการแชร์ (ใช้งานในอีกฝั่งของการเชื่อมต่อ)"), ("Show RustDesk", "แสดง RustDesk"), - ("This PC", ""), + ("This PC", "พีซีเครื่องนี้"), ("or", "หรือ"), ("Continue with", "ทำต่อด้วย"), ("Elevate", "ยกระดับ"), @@ -418,144 +418,144 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Closed manually by web console", "ถูกปิดโดยเว็บคอนโซล"), ("Local keyboard type", "ประเภทคีย์บอร์ด"), ("Select local keyboard type", "เลือกประเภทคีย์บอร์ด"), - ("software_render_tip", ""), - ("Always use software rendering", ""), - ("config_input", ""), - ("config_microphone", ""), - ("request_elevation_tip", ""), - ("Wait", ""), - ("Elevation Error", ""), - ("Ask the remote user for authentication", ""), - ("Choose this if the remote account is administrator", ""), - ("Transmit the username and password of administrator", ""), - ("still_click_uac_tip", ""), - ("Request Elevation", ""), - ("wait_accept_uac_tip", ""), - ("Elevate successfully", ""), - ("uppercase", ""), - ("lowercase", ""), - ("digit", ""), - ("special character", ""), - ("length>=8", ""), - ("Weak", ""), - ("Medium", ""), - ("Strong", ""), - ("Switch Sides", ""), - ("Please confirm if you want to share your desktop?", ""), - ("Display", ""), - ("Default View Style", ""), - ("Default Scroll Style", ""), - ("Default Image Quality", ""), - ("Default Codec", ""), + ("software_render_tip", "ถ้าคุณใช้กราฟิกการ์ดกับระบบ Linux และหน้าต่างของเครื่องปลายทางปิดในทันทีหลังจากการเชื่อมต่อ การเปลี่ยนไปใช้ไดรเวอร์ Nouveau และเลือกใช้โหมดการเรนเดอร์แบบซอฟท์แวร์อาจช่วยได้ (ต้องรีสตาร์ทโปรแกรม)"), + ("Always use software rendering", "ใช้การเรนเดอร์แบบซอฟท์แวร์เสมอ"), + ("config_input", "เพื่อที่จะควบคุมเครื่องเดสก์ท็อปปลายทางด้วยคีย์บอร์ด คุณจำเป็นจะต้องอนุญาตสิทธิ์ \"การตรวจสอบ Input\" ให้แก่ Rustdesk"), + ("config_microphone", "เพื่อที่จะส่งเสียงพูดไปยังปลายทาง คุณจำเป็นจะต้องอนุญาตสิทธิ์ \"การบันทึกเสียง\" ให้แก่ Rustdesk"), + ("request_elevation_tip", "คุณสามารถขอยกระดับสิทธิ์การใช้งานได้ หากมีผู้ใช้งานอยู่ในฝั่งเครื่องปลายทาง"), + ("Wait", "รอ"), + ("Elevation Error", "การยกระดับสิทธิ์การใช้งานผิดพลาด"), + ("Ask the remote user for authentication", "ขอความช่วยเหลือผู้ใช้งานปลายทางเพื่อพิสูจน์ตัวตน"), + ("Choose this if the remote account is administrator", "เลือกข้อนี้ถ้าบัญชีผู้ใช้งานปลายทางเป็นผู้ดูแลระบบ"), + ("Transmit the username and password of administrator", "ส่งข้อมูลผู้ใช้งานและรหัสผ่านของผู้ดูแลระบบ"), + ("still_click_uac_tip", "ผู้ใช้งานปลายทางยังจำเป็นที่จะต้องกดปุ่ม ตกลง บนหน้าต่าง UAC ของ Rustdesk"), + ("Request Elevation", "ขอยกระดับสิทธิ์การใช้งาน"), + ("wait_accept_uac_tip", "กรุณารอผู้ใช้งานปลายทางกดยินยอมหน้าต่าง UAC"), + ("Elevate successfully", "การยกระดับสิทธิ์การใช้งานสำเร็จ"), + ("uppercase", "พิมพ์ใหญ่"), + ("lowercase", "พิมพ์เล็ก"), + ("digit", "หลัก"), + ("special character", "อักขระพิเศษ"), + ("length>=8", "ความยาวมากกว่า 8"), + ("Weak", "ไม่ปลอดภัย"), + ("Medium", "กลาง"), + ("Strong", "ปลอดภัย"), + ("Switch Sides", "สลับฝั่ง"), + ("Please confirm if you want to share your desktop?", "กรุณายืนยันว่าคุณต้องการแบ่งปันหน้าเดสก์ท็อปของคุณ"), + ("Display", "จอแสดงผล"), + ("Default View Style", "แสดงผลแบบเริ่มต้น"), + ("Default Scroll Style", "การเลื่อนแบบเริ่มต้น"), + ("Default Image Quality", "คุณภาพของภาพแบบเริ่มต้น"), + ("Default Codec", "Codec เริ่มต้น"), ("Bitrate", ""), ("FPS", ""), - ("Auto", ""), - ("Other Default Options", ""), - ("Voice call", ""), - ("Text chat", ""), - ("Stop voice call", ""), - ("relay_hint_tip", ""), - ("Reconnect", ""), + ("Auto", "อัตโนมัติ"), + ("Other Default Options", "ตัวเลือกเริ่มต้นอื่นๆ"), + ("Voice call", "การโทรด้วยเสียง"), + ("Text chat", "การสนทนาด้วยข้อความ"), + ("Stop voice call", "หยุดการโทรด้วยเสียง"), + ("relay_hint_tip", "การเชื่อมต่อโดยตรงอาจเป็นไปไม่ได้ ดังนั้นคุณสามารถลองเชื่อมต่อผ่าน Relay หรือตั้งค่าให้เชื่อมต่อผ่าน Relay เป็นค่าเริ่มต้น คุณสามารถเพิ่ม \"/r\" ต่อท้ายไปยัง ID หรือเลือกตัวเลือก \"เชื่อมต่อผ่าน Relay เสมอ\" ในการ์ดของการเชื่อมต่อล่าสุด (ถ้ามี)"), + ("Reconnect", "เชื่อมต่ออีกครั้ง"), ("Codec", ""), - ("Resolution", ""), - ("No transfers in progress", ""), - ("Set one-time password length", ""), - ("install_cert_tip", ""), - ("confirm_install_cert_tip", ""), - ("RDP Settings", ""), - ("Sort by", ""), - ("New Connection", ""), - ("Restore", ""), - ("Minimize", ""), - ("Maximize", ""), - ("Your Device", ""), - ("empty_recent_tip", ""), - ("empty_favorite_tip", ""), - ("empty_lan_tip", ""), - ("empty_address_book_tip", ""), - ("eg: admin", ""), - ("Empty Username", ""), - ("Empty Password", ""), - ("Me", ""), - ("identical_file_tip", ""), - ("show_monitors_tip", ""), - ("View Mode", ""), - ("login_linux_tip", ""), - ("verify_rustdesk_password_tip", ""), - ("remember_account_tip", ""), - ("os_account_desk_tip", ""), - ("OS Account", ""), - ("another_user_login_title_tip", ""), - ("another_user_login_text_tip", ""), - ("xorg_not_found_title_tip", ""), - ("xorg_not_found_text_tip", ""), - ("no_desktop_title_tip", ""), - ("no_desktop_text_tip", ""), - ("No need to elevate", ""), - ("System Sound", ""), - ("Default", ""), - ("New RDP", ""), - ("Fingerprint", ""), - ("Copy Fingerprint", ""), - ("no fingerprints", ""), - ("Select a peer", ""), - ("Select peers", ""), - ("Plugins", ""), - ("Uninstall", ""), - ("Update", ""), - ("Enable", ""), - ("Disable", ""), - ("Options", ""), - ("resolution_original_tip", ""), - ("resolution_fit_local_tip", ""), - ("resolution_custom_tip", ""), - ("Collapse toolbar", ""), - ("Accept and Elevate", ""), - ("accept_and_elevate_btn_tooltip", ""), - ("clipboard_wait_response_timeout_tip", ""), - ("Incoming connection", ""), - ("Outgoing connection", ""), - ("Exit", ""), - ("Open", ""), - ("logout_tip", ""), - ("Service", ""), - ("Start", ""), - ("Stop", ""), - ("exceed_max_devices", ""), - ("Sync with recent sessions", ""), - ("Sort tags", ""), - ("Open connection in new tab", ""), - ("Move tab to new window", ""), - ("Can not be empty", ""), - ("Already exists", ""), - ("Change Password", ""), - ("Refresh Password", ""), + ("Resolution", "ความละเอียด"), + ("No transfers in progress", "ไม่มีการถ่ายโอนในขณะนี้"), + ("Set one-time password length", "ตั้งค่าความยาวรหัสผ่านครั้งเดียว"), + ("install_cert_tip", "ติดตั้งใบรับรองของ Rustdesk"), + ("confirm_install_cert_tip", "นี่คือใบรับของทดสอบของ Rustdesk ซึ่งสามารถเชื่อถือได้ ใบรับรองนี้จะถูกใช้ในการติดตั้ง Driver ของ Rustdesk เมื่อจำเป็น"), + ("RDP Settings", "การตั้งค่า RDP"), + ("Sort by", "เรียงลำดับโดย"), + ("New Connection", "การเชื่อมต่อใหม่"), + ("Restore", "คืนค่า"), + ("Minimize", "ย่อ"), + ("Maximize", "ขยาย"), + ("Your Device", "อุปกรณ์ของคุณ"), + ("empty_recent_tip", "คุณยังไม่มีการเชื่อมต่อล่าสุด ได้เวลาวางแผนเพื่อเริ่มต้นแล้ว"), + ("empty_favorite_tip", "ยังไม่มีการเชื่อมต่อรายการโปรดเหรอ? มาเริ่มต้นหาใครซักคนเพื่อเชื่อมต่อด้วย และเพิ่มเข้าไปยังรายการโปรดของคุณกัน"), + ("empty_lan_tip", "ไม่นะ ดูเหมือนว่าเราจะยังไม่พบใครตรงนี้"), + ("empty_address_book_tip", "ดูเหมือนว่าคุณยังไม่มีใครถูกบันทึกในสมุดรายชื่อของคุณ"), + ("eg: admin", "เช่น ผู้ดูแลระบบ"), + ("Empty Username", "ชื่อผู้ใช้งานว่างเปล่า"), + ("Empty Password", "รหัสผ่านว่างเปล่า"), + ("Me", "ฉัน"), + ("identical_file_tip", "ไฟล์นี้เหมือนกับไฟล์ของอีกฝั่ง"), + ("show_monitors_tip", "แสดงหน้าจอในแถบเครื่องมือ"), + ("View Mode", "โหมดการดู"), + ("login_linux_tip", "คุณจำเป็นจะต้องเข้าสู่ระบบไปยังบัญชีลินุกซ์ปลายทางเพื่อใช้งานเดสก์ท็อปเซสชัน X"), + ("verify_rustdesk_password_tip", "ยืนยันความถูกต้องรหัสผ่านของ Rustdesk"), + ("remember_account_tip", "จดจำบัญชีนี้"), + ("os_account_desk_tip", "บัญชีนี้จะถูกใช้ในการเข้าสู่ระบบเครื่องปลายทางและเริ่มใช้งานเดสก์ท็อปเซสชันแบบ headless"), + ("OS Account", "บัญชีระบบปฏิบัติการ"), + ("another_user_login_title_tip", "ผู้ใช้งานอื่นเข้าสู่ระบบอยู่แล้ว"), + ("another_user_login_text_tip", "ยกเลิกการเชื่อมต่อ"), + ("xorg_not_found_title_tip", "ไม่พบ Xorg"), + ("xorg_not_found_text_tip", "กรุณาติดตั้ง Xorg"), + ("no_desktop_title_tip", "ไม่มีหน้าเดสก์ท็อปที่ใช้งานได้"), + ("no_desktop_text_tip", "กรุณาติดตั้ง GNOME เดสกท็อป"), + ("No need to elevate", "ไม่จำเป็นต้องยกระดับสิทธิ์การใช้งาน"), + ("System Sound", "เสียงของระบบ"), + ("Default", "ค่าเริ่มต้น"), + ("New RDP", "RDP ใหม่"), + ("Fingerprint", "ลายนิ้วมือ"), + ("Copy Fingerprint", "คัดลอกลายนิ้วมือ"), + ("no fingerprints", "ไม่มีลายนิ้วมือ"), + ("Select a peer", "เลือกผู้ใช้งาน"), + ("Select peers", "เลือกผู้ใช้งาน"), + ("Plugins", "ปลั๊กอิน"), + ("Uninstall", "ถอนการติดตั้ง"), + ("Update", "อัปเดต"), + ("Enable", "เปิดใช้งาน"), + ("Disable", "ปิดใช้งาน"), + ("Options", "ตัวเลือก"), + ("resolution_original_tip", "ความละเอียดดั้งเดิม"), + ("resolution_fit_local_tip", "ความละเอียดตามต้นทาง"), + ("resolution_custom_tip", "ความละเอียดแบบกำหนดเอง"), + ("Collapse toolbar", "พับแถบเครื่องมือ"), + ("Accept and Elevate", "ยอมรับ และยกระดับสิทธิ์การใช้งาน"), + ("accept_and_elevate_btn_tooltip", "ยอมรับการเชื่อมต่อ และยกระดับสิทธิ์ UAC"), + ("clipboard_wait_response_timeout_tip", "หมดเวลารอการตอบสนองของการคัดลอก"), + ("Incoming connection", "การเชื่อมต่อขาเข้า"), + ("Outgoing connection", "การเชื่อมต่อขาออก"), + ("Exit", "ออก"), + ("Open", "เปิด"), + ("logout_tip", "คุณแน่ใจที่จะออกจากระบบหรือไม่?"), + ("Service", "เซอร์วิส"), + ("Start", "เริ่ม"), + ("Stop", "หยุด"), + ("exceed_max_devices", "จำนวนอุปกรณ์ที่จัดการของคุณเต็มจำนวนแล้ว"), + ("Sync with recent sessions", "Sync กับเซสชันล่าสุด"), + ("Sort tags", "เรียงแท็ก"), + ("Open connection in new tab", "เริ่มการเชื่อมต่อในแท็บใหม่"), + ("Move tab to new window", "ย้ายแท็บไปหน้าต่างใหม่"), + ("Can not be empty", "ไม่สามารถเว้นว่างได้"), + ("Already exists", "มีอยู่แล้ว"), + ("Change Password", "เปลี่ยนรหัสผ่าน"), + ("Refresh Password", "รีเฟรชรหัสผ่าน"), ("ID", ""), - ("Grid View", ""), - ("List View", ""), - ("Select", ""), - ("Toggle Tags", ""), - ("pull_ab_failed_tip", ""), - ("push_ab_failed_tip", ""), - ("synced_peer_readded_tip", ""), - ("Change Color", ""), - ("Primary Color", ""), - ("HSV Color", ""), - ("Installation Successful!", ""), - ("Installation failed!", ""), - ("Reverse mouse wheel", ""), - ("{} sessions", ""), - ("scam_title", ""), - ("scam_text1", ""), - ("scam_text2", ""), - ("Don't show again", ""), - ("I Agree", ""), - ("Decline", ""), - ("Timeout in minutes", ""), - ("auto_disconnect_option_tip", ""), - ("Connection failed due to inactivity", ""), - ("Check for software update on startup", ""), - ("upgrade_rustdesk_server_pro_to_{}_tip", ""), - ("pull_group_failed_tip", ""), + ("Grid View", "มุมมองแบบช่อง"), + ("List View", "มุมมองแบบรายการ"), + ("Select", "เลือก"), + ("Toggle Tags", "สลับแท็ก"), + ("pull_ab_failed_tip", "การรีเฟรชสมุดรายชื่อล้มเหลว"), + ("push_ab_failed_tip", "การ Sync สมุดรายชื่อไปยังเซิร์ฟเวอร์ล้มเหลว"), + ("synced_peer_readded_tip", "อุปกรณ์ที่อยู่ในรายการล่าสุดจะถูก sync กลับไปยังสมุดรายชื่อ"), + ("Change Color", "เปลี่ยนสี"), + ("Primary Color", "สีหลัก"), + ("HSV Color", "สี HSV"), + ("Installation Successful!", "การติดตั้งเสร็จสมบูรณ์"), + ("Installation failed!", "การติดตั้งล้มเหลว"), + ("Reverse mouse wheel", "เลื่อมลูกกลิ้งเมาส์แบบกลับด้าน"), + ("{} sessions", "{} เซสชัน"), + ("scam_title", "คุณอาจกำลังถูกหลอกลวง!"), + ("scam_text1", "ถ้าคุณกำลังคุยโทรศัพท์กับคนที่คุณไม่รู้จักและไม่ไว้ใจ และคนๆนั้นกำลังขอให้คุณเปิดใช้งาน Rustdesk อย่าทำตามและรีบวางสายในทันที"), + ("scam_text2", "เขาเหล่านั้นอาจเป็นมิจฉาชีพที่กำลังพยายามจะขโมยเงินและข้อมูลส่วนตัวของคุณ"), + ("Don't show again", "อย่าแสดงอีก"), + ("I Agree", "ยอมรับ"), + ("Decline", "ปฏิเสธ"), + ("Timeout in minutes", "หมดเวลาในอีกซักครู่"), + ("auto_disconnect_option_tip", "ยกเลิกการเชื่อมต่ออัตโนมัติในกรณีที่ผู้ใช้งานไม่มีการเคลื่อนไหว"), + ("Connection failed due to inactivity", "การเชื่อมต่อล้มเหลวเนื่องจากไม่มีการเคลื่อนไหว"), + ("Check for software update on startup", "ตรวจสอบการอัปเดตโปรแกรมเมื่อเริ่มต้นใช้งาน"), + ("upgrade_rustdesk_server_pro_to_{}_tip", "กรุณาอัปเดต Rustdesk Server Pro ไปยังเวอร์ชัน {} หรือใหม่กว่า!"), + ("pull_group_failed_tip", "การเรียกใช้งานกลุ่มล้มเหลว"), ].iter().cloned().collect(); } From ee994ea393da0e9e4733fb38fa2c8b41c99f1caa Mon Sep 17 00:00:00 2001 From: RayJW <29835902+RayJW@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:22:14 +0200 Subject: [PATCH 64/71] Bumped fd runtime --- flatpak/rustdesk.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flatpak/rustdesk.json b/flatpak/rustdesk.json index 4d2e297cc..fb62d9250 100644 --- a/flatpak/rustdesk.json +++ b/flatpak/rustdesk.json @@ -1,7 +1,7 @@ { "id": "com.rustdesk.RustDesk", "runtime": "org.freedesktop.Platform", - "runtime-version": "21.08", + "runtime-version": "23.08", "sdk": "org.freedesktop.Sdk", "command": "rustdesk", "icon": "share/icons/hicolor/scalable/apps/rustdesk.svg", From 431150c262315cdd56d75ce80987421beeac6a8b Mon Sep 17 00:00:00 2001 From: RayJW <29835902+RayJW@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:28:07 +0200 Subject: [PATCH 65/71] Bumped fd runtime in CI --- .github/workflows/flutter-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/flutter-build.yml b/.github/workflows/flutter-build.yml index 7c5fc4ba1..d363295a6 100644 --- a/.github/workflows/flutter-build.yml +++ b/.github/workflows/flutter-build.yml @@ -1614,8 +1614,8 @@ jobs: # apt install -y flatpak flatpak-builder cmake g++ gcc git curl wget nasm yasm libgtk-3-dev git # # flatpak deps # flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - # flatpak --user install -y flathub org.freedesktop.Platform/${{ matrix.job.arch }}/21.08 - # flatpak --user install -y flathub org.freedesktop.Sdk/${{ matrix.job.arch }}/21.08 + # flatpak --user install -y flathub org.freedesktop.Platform/${{ matrix.job.arch }}/23.08 + # flatpak --user install -y flathub org.freedesktop.Sdk/${{ matrix.job.arch }}/23.08 # # package # pushd flatpak # git clone https://github.com/flathub/shared-modules.git --depth=1 @@ -1677,8 +1677,8 @@ jobs: apt install -y flatpak flatpak-builder cmake g++ gcc git curl wget nasm yasm libgtk-3-dev git # flatpak deps flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - flatpak --user install -y flathub org.freedesktop.Platform/${{ matrix.job.arch }}/21.08 - flatpak --user install -y flathub org.freedesktop.Sdk/${{ matrix.job.arch }}/21.08 + flatpak --user install -y flathub org.freedesktop.Platform/${{ matrix.job.arch }}/23.08 + flatpak --user install -y flathub org.freedesktop.Sdk/${{ matrix.job.arch }}/23.08 # package pushd flatpak git clone https://github.com/flathub/shared-modules.git --depth=1 From 8cc5aee5282f1ed7c1371fb4bcd46a70c006a92a Mon Sep 17 00:00:00 2001 From: fufesou Date: Fri, 6 Oct 2023 23:36:49 +0800 Subject: [PATCH 66/71] fix, mobile curosr (hotx,hoty) Signed-off-by: fufesou --- flutter/lib/mobile/pages/remote_page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flutter/lib/mobile/pages/remote_page.dart b/flutter/lib/mobile/pages/remote_page.dart index f5b6270f9..b38adf63e 100644 --- a/flutter/lib/mobile/pages/remote_page.dart +++ b/flutter/lib/mobile/pages/remote_page.dart @@ -740,8 +740,8 @@ class CursorPaint extends StatelessWidget { return CustomPaint( painter: ImagePainter( image: m.image ?? preDefaultCursor.image, - x: m.x * s - hotx * s + c.x, - y: m.y * s - hoty * s + c.y - adjust, + x: m.x * s - hotx + c.x, + y: m.y * s - hoty + c.y - adjust, scale: 1), ); } From da7bcf89d400db54bb0a1b158f5a02a4228f4b56 Mon Sep 17 00:00:00 2001 From: fufesou Date: Fri, 6 Oct 2023 21:31:37 +0800 Subject: [PATCH 67/71] fix, wayland --server, envs Signed-off-by: fufesou --- src/platform/linux.rs | 110 +++++++++++++++++++++++++++++---------- src/server/connection.rs | 6 ++- 2 files changed, 88 insertions(+), 28 deletions(-) diff --git a/src/platform/linux.rs b/src/platform/linux.rs index de8c9d732..8ab7693b0 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -14,6 +14,7 @@ use hbb_common::{ }; use std::{ cell::RefCell, + ffi::OsStr, io::Write, path::{Path, PathBuf}, process::{Child, Command}, @@ -195,17 +196,29 @@ fn start_uinput_service() { } #[inline] -fn try_start_server_(user: Option<(String, String)>) -> ResultType> { - if user.is_some() { - run_as_user(vec!["--server"], user) - } else { - Ok(Some(crate::run_me(vec!["--server"])?)) +fn try_start_server_(desktop: Option<&Desktop>) -> ResultType> { + match desktop { + Some(desktop) => { + let mut envs = vec![]; + if !desktop.display.is_empty() { + envs.push(("DISPLAY", desktop.display.clone())); + } + if !desktop.xauth.is_empty() { + envs.push(("XAUTHORITY", desktop.xauth.clone())); + } + run_as_user( + vec!["--server"], + Some((desktop.uid.clone(), desktop.username.clone())), + envs, + ) + } + None => Ok(Some(crate::run_me(vec!["--server"])?)), } } #[inline] -fn start_server(user: Option<(String, String)>, server: &mut Option) { - match try_start_server_(user) { +fn start_server(desktop: Option<&Desktop>, server: &mut Option) { + match try_start_server_(desktop) { Ok(ps) => *server = ps, Err(err) => { log::error!("Failed to start server: {}", err); @@ -257,6 +270,7 @@ fn stop_subprocess() { fn should_start_server( try_x11: bool, + is_display_changed: bool, uid: &mut String, desktop: &Desktop, cm0: &mut bool, @@ -273,7 +287,7 @@ fn should_start_server( *uid = "".to_owned(); should_kill = true; } - } else if desktop.uid != *uid && !desktop.uid.is_empty() { + } else if is_display_changed || desktop.uid != *uid && !desktop.uid.is_empty() { *uid = desktop.uid.clone(); if try_x11 { set_x11_env(&desktop); @@ -335,6 +349,7 @@ pub fn start_os_service() { let running = Arc::new(AtomicBool::new(true)); let r = running.clone(); + let (mut display, mut xauth): (String, String) = ("".to_owned(), "".to_owned()); let mut desktop = Desktop::default(); let mut sid = "".to_owned(); let mut uid = "".to_owned(); @@ -357,8 +372,10 @@ pub fn start_os_service() { // try kill subprocess "--server" stop_server(&mut user_server); // try start subprocess "--server" + // No need to check is_display_changed here. if should_start_server( true, + false, &mut uid, &desktop, &mut cm0, @@ -373,9 +390,14 @@ pub fn start_os_service() { // try kill subprocess "--server" stop_server(&mut server); + let is_display_changed = desktop.display != display || desktop.xauth != xauth; + display = desktop.display.clone(); + xauth = desktop.xauth.clone(); + // try start subprocess "--server" if should_start_server( false, + is_display_changed, &mut uid, &desktop, &mut cm0, @@ -384,10 +406,7 @@ pub fn start_os_service() { ) { stop_subprocess(); force_stop_server(); - start_server( - Some((desktop.uid.clone(), desktop.username.clone())), - &mut user_server, - ); + start_server(Some(&desktop), &mut user_server); } } else { force_stop_server(); @@ -541,7 +560,16 @@ fn is_opensuse() -> bool { false } -pub fn run_as_user(arg: Vec<&str>, user: Option<(String, String)>) -> ResultType> { +pub fn run_as_user( + arg: Vec<&str>, + user: Option<(String, String)>, + envs: I, +) -> ResultType> +where + I: IntoIterator, + K: AsRef, + V: AsRef, +{ let (uid, username) = match user { Some(id_name) => id_name, None => get_active_user_id_name(), @@ -558,7 +586,7 @@ pub fn run_as_user(arg: Vec<&str>, user: Option<(String, String)>) -> ResultType args.insert(0, "-E"); } - let task = Command::new("sudo").args(args).spawn()?; + let task = Command::new("sudo").envs(envs).args(args).spawn()?; Ok(Some(task)) } @@ -652,7 +680,7 @@ pub(super) fn get_env_tries(name: &str, uid: &str, process: &str, n: usize) -> S #[inline] fn get_env(name: &str, uid: &str, process: &str) -> String { - let cmd = format!("ps -u {} -f | grep '{}' | grep -v 'grep' | tail -1 | awk '{{print $2}}' | xargs -I__ cat /proc/__/environ 2>/dev/null | tr '\\0' '\\n' | grep '^{}=' | tail -1 | sed 's/{}=//g'", uid, process, name, name); + let cmd = format!("ps -u {} -f | grep -E '{}' | grep -v 'grep' | tail -1 | awk '{{print $2}}' | xargs -I__ cat /proc/__/environ 2>/dev/null | tr '\\0' '\\n' | grep '^{}=' | tail -1 | sed 's/{}=//g'", uid, process, name, name); if let Ok(x) = run_cmds(&cmd) { x.trim_end().to_string() } else { @@ -887,9 +915,11 @@ mod desktop { use super::*; pub const XFCE4_PANEL: &str = "xfce4-panel"; - pub const GNOME_SESSION_BINARY: &str = "gnome-session-binary"; pub const SDDM_GREETER: &str = "sddm-greeter"; - pub const PLASMA_X11: &str = "startplasma-x11"; + + const PLASMA_KDED5: &str = "kded5"; + const GNOME_GOA_DAEMON: &str = "goa-daemon"; + const RUSTDESK_TRAY: &str = "rustdesk +--tray"; #[derive(Debug, Clone, Default)] pub struct Desktop { @@ -918,10 +948,30 @@ mod desktop { self.sid.is_empty() || self.is_rustdesk_subprocess } - fn get_display(&mut self) { - let display_envs = vec![GNOME_SESSION_BINARY, XFCE4_PANEL, SDDM_GREETER, PLASMA_X11]; - for diplay_env in display_envs { - self.display = get_env_tries("DISPLAY", &self.uid, diplay_env, 10); + fn get_display_wayland(&mut self) { + let display_proc = vec![PLASMA_KDED5, GNOME_GOA_DAEMON, RUSTDESK_TRAY]; + for proc in display_proc { + self.display = get_env("DISPLAY", &self.uid, proc); + if !self.display.is_empty() { + break; + } + } + } + + fn get_xauth_wayland(&mut self) { + let display_proc = vec![PLASMA_KDED5, GNOME_GOA_DAEMON, RUSTDESK_TRAY]; + for proc in display_proc { + self.xauth = get_env("XAUTHORITY", &self.uid, proc); + if !self.xauth.is_empty() { + break; + } + } + } + + fn get_display_x11(&mut self) { + let display_envs = vec![PLASMA_KDED5, GNOME_GOA_DAEMON, XFCE4_PANEL, SDDM_GREETER]; + for display_env in display_envs { + self.display = get_env_tries("DISPLAY", &self.uid, display_env, 10); if !self.display.is_empty() { break; } @@ -980,9 +1030,9 @@ mod desktop { } } - fn get_xauth(&mut self) { + fn get_xauth_x11(&mut self) { // try by direct access to window manager process by name - let display_envs = vec![GNOME_SESSION_BINARY, XFCE4_PANEL, SDDM_GREETER, PLASMA_X11]; + let display_envs = vec![PLASMA_KDED5, GNOME_GOA_DAEMON, XFCE4_PANEL, SDDM_GREETER]; for diplay_env in display_envs { self.xauth = get_env_tries("XAUTHORITY", &self.uid, diplay_env, 10); if !self.xauth.is_empty() { @@ -1088,16 +1138,22 @@ mod desktop { self.uid = seat0_values[1].clone(); self.username = seat0_values[2].clone(); self.protocal = get_display_server_of_session(&self.sid).into(); - if self.is_wayland() { + if self.is_login_wayland() { self.display = "".to_owned(); self.xauth = "".to_owned(); self.is_rustdesk_subprocess = false; return; } - self.get_display(); - self.get_xauth(); - self.set_is_subprocess(); + if self.is_wayland() { + self.get_display_wayland(); + self.get_xauth_wayland(); + self.is_rustdesk_subprocess = false; + } else { + self.get_display_x11(); + self.get_xauth_x11(); + self.set_is_subprocess(); + } } } } diff --git a/src/server/connection.rs b/src/server/connection.rs index 35538a85a..7da5e4086 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -2522,7 +2522,11 @@ async fn start_ipc( #[cfg(target_os = "linux")] { log::debug!("Start cm"); - res = crate::platform::run_as_user(args.clone(), user.clone()); + res = crate::platform::run_as_user( + args.clone(), + user.clone(), + None::<(&str, &str)>, + ); } if res.is_ok() { break; From b7a4c0664b950b75190dd0d4796a2a3bcec51408 Mon Sep 17 00:00:00 2001 From: fufesou Date: Fri, 6 Oct 2023 23:34:40 +0800 Subject: [PATCH 68/71] fix, wayland --server, display env, better way to find the envs Signed-off-by: fufesou --- src/platform/linux.rs | 84 +++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 39 deletions(-) diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 8ab7693b0..3a140051c 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -667,17 +667,6 @@ pub fn is_installed() -> bool { } } -pub(super) fn get_env_tries(name: &str, uid: &str, process: &str, n: usize) -> String { - for _ in 0..n { - let x = get_env(name, uid, process); - if !x.is_empty() { - return x; - } - sleep_millis(300); - } - "".to_owned() -} - #[inline] fn get_env(name: &str, uid: &str, process: &str) -> String { let cmd = format!("ps -u {} -f | grep -E '{}' | grep -v 'grep' | tail -1 | awk '{{print $2}}' | xargs -I__ cat /proc/__/environ 2>/dev/null | tr '\\0' '\\n' | grep '^{}=' | tail -1 | sed 's/{}=//g'", uid, process, name, name); @@ -917,6 +906,7 @@ mod desktop { pub const XFCE4_PANEL: &str = "xfce4-panel"; pub const SDDM_GREETER: &str = "sddm-greeter"; + const IBUS_DAEMON: &str = "ibus-daemon"; const PLASMA_KDED5: &str = "kded5"; const GNOME_GOA_DAEMON: &str = "goa-daemon"; const RUSTDESK_TRAY: &str = "rustdesk +--tray"; @@ -948,33 +938,36 @@ mod desktop { self.sid.is_empty() || self.is_rustdesk_subprocess } - fn get_display_wayland(&mut self) { - let display_proc = vec![PLASMA_KDED5, GNOME_GOA_DAEMON, RUSTDESK_TRAY]; - for proc in display_proc { - self.display = get_env("DISPLAY", &self.uid, proc); - if !self.display.is_empty() { - break; - } - } - } - - fn get_xauth_wayland(&mut self) { - let display_proc = vec![PLASMA_KDED5, GNOME_GOA_DAEMON, RUSTDESK_TRAY]; - for proc in display_proc { - self.xauth = get_env("XAUTHORITY", &self.uid, proc); - if !self.xauth.is_empty() { - break; + fn get_display_xauth_wayland(&mut self) { + for _ in 0..5 { + let display_proc = vec![IBUS_DAEMON, GNOME_GOA_DAEMON, PLASMA_KDED5, RUSTDESK_TRAY]; + for proc in display_proc { + self.display = get_env("DISPLAY", &self.uid, proc); + self.xauth = get_env("XAUTHORITY", &self.uid, proc); + if !self.display.is_empty() && !self.xauth.is_empty() { + break; + } } + sleep_millis(300); } } fn get_display_x11(&mut self) { - let display_envs = vec![PLASMA_KDED5, GNOME_GOA_DAEMON, XFCE4_PANEL, SDDM_GREETER]; - for display_env in display_envs { - self.display = get_env_tries("DISPLAY", &self.uid, display_env, 10); - if !self.display.is_empty() { - break; + for _ in 0..10 { + let display_proc = vec![ + IBUS_DAEMON, + GNOME_GOA_DAEMON, + PLASMA_KDED5, + XFCE4_PANEL, + SDDM_GREETER, + ]; + for proc in display_proc { + self.display = get_env("DISPLAY", &self.uid, proc); + if !self.display.is_empty() { + break; + } } + sleep_millis(300); } if self.display.is_empty() { @@ -1032,12 +1025,21 @@ mod desktop { fn get_xauth_x11(&mut self) { // try by direct access to window manager process by name - let display_envs = vec![PLASMA_KDED5, GNOME_GOA_DAEMON, XFCE4_PANEL, SDDM_GREETER]; - for diplay_env in display_envs { - self.xauth = get_env_tries("XAUTHORITY", &self.uid, diplay_env, 10); - if !self.xauth.is_empty() { - break; + for _ in 0..10 { + let display_proc = vec![ + IBUS_DAEMON, + GNOME_GOA_DAEMON, + PLASMA_KDED5, + XFCE4_PANEL, + SDDM_GREETER, + ]; + for proc in display_proc { + self.xauth = get_env("XAUTHORITY", &self.uid, proc); + if !self.xauth.is_empty() { + break; + } } + sleep_millis(300); } // get from Xorg process, parameter and environment @@ -1124,6 +1126,11 @@ mod desktop { pub fn refresh(&mut self) { if !self.sid.is_empty() && is_active_and_seat0(&self.sid) { + // Wayland display and xauth may not be available in a short time after login. + if self.is_wayland() && !self.is_login_wayland() { + self.get_display_xauth_wayland(); + self.is_rustdesk_subprocess = false; + } return; } @@ -1146,8 +1153,7 @@ mod desktop { } if self.is_wayland() { - self.get_display_wayland(); - self.get_xauth_wayland(); + self.get_display_xauth_wayland(); self.is_rustdesk_subprocess = false; } else { self.get_display_x11(); From 4326bfa504c4f982088ef556da208b0a38fd87cb Mon Sep 17 00:00:00 2001 From: fufesou Date: Fri, 6 Oct 2023 20:51:29 -0500 Subject: [PATCH 69/71] fix, xwayland server envs, check Xwayland Signed-off-by: fufesou --- src/platform/linux.rs | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/platform/linux.rs b/src/platform/linux.rs index 3a140051c..e37e6f53c 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -900,12 +900,21 @@ pub fn change_resolution_directly(name: &str, width: usize, height: usize) -> Re Ok(()) } +#[inline] +pub fn is_xwayland_running() -> bool { + if let Ok(output) = run_cmds("pgrep -a Xwayland") { + return !output.contains("Xwayland"); + } + false +} + mod desktop { use super::*; pub const XFCE4_PANEL: &str = "xfce4-panel"; pub const SDDM_GREETER: &str = "sddm-greeter"; + const XWAYLAND: &str = "Xwayland"; const IBUS_DAEMON: &str = "ibus-daemon"; const PLASMA_KDED5: &str = "kded5"; const GNOME_GOA_DAEMON: &str = "goa-daemon"; @@ -938,9 +947,15 @@ mod desktop { self.sid.is_empty() || self.is_rustdesk_subprocess } - fn get_display_xauth_wayland(&mut self) { + fn get_display_xauth_xwayland(&mut self) { for _ in 0..5 { - let display_proc = vec![IBUS_DAEMON, GNOME_GOA_DAEMON, PLASMA_KDED5, RUSTDESK_TRAY]; + let display_proc = vec![ + XWAYLAND, + IBUS_DAEMON, + GNOME_GOA_DAEMON, + PLASMA_KDED5, + RUSTDESK_TRAY, + ]; for proc in display_proc { self.display = get_env("DISPLAY", &self.uid, proc); self.xauth = get_env("XAUTHORITY", &self.uid, proc); @@ -955,6 +970,7 @@ mod desktop { fn get_display_x11(&mut self) { for _ in 0..10 { let display_proc = vec![ + XWAYLAND, IBUS_DAEMON, GNOME_GOA_DAEMON, PLASMA_KDED5, @@ -1027,6 +1043,7 @@ mod desktop { // try by direct access to window manager process by name for _ in 0..10 { let display_proc = vec![ + XWAYLAND, IBUS_DAEMON, GNOME_GOA_DAEMON, PLASMA_KDED5, @@ -1127,8 +1144,8 @@ mod desktop { pub fn refresh(&mut self) { if !self.sid.is_empty() && is_active_and_seat0(&self.sid) { // Wayland display and xauth may not be available in a short time after login. - if self.is_wayland() && !self.is_login_wayland() { - self.get_display_xauth_wayland(); + if is_xwayland_running() && !self.is_login_wayland() { + self.get_display_xauth_xwayland(); self.is_rustdesk_subprocess = false; } return; @@ -1153,7 +1170,12 @@ mod desktop { } if self.is_wayland() { - self.get_display_xauth_wayland(); + if is_xwayland_running() { + self.get_display_xauth_xwayland(); + } else { + self.display = "".to_owned(); + self.xauth = "".to_owned(); + } self.is_rustdesk_subprocess = false; } else { self.get_display_x11(); From bd6323ccaee854da76951c989864d58af69e8475 Mon Sep 17 00:00:00 2001 From: fufesou Date: Fri, 6 Oct 2023 23:15:51 -0500 Subject: [PATCH 70/71] fix, xwayland server env, check xwayland running Signed-off-by: fufesou --- src/platform/linux.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/linux.rs b/src/platform/linux.rs index e37e6f53c..0f926c469 100644 --- a/src/platform/linux.rs +++ b/src/platform/linux.rs @@ -903,7 +903,7 @@ pub fn change_resolution_directly(name: &str, width: usize, height: usize) -> Re #[inline] pub fn is_xwayland_running() -> bool { if let Ok(output) = run_cmds("pgrep -a Xwayland") { - return !output.contains("Xwayland"); + return output.contains("Xwayland"); } false } @@ -1143,7 +1143,7 @@ mod desktop { pub fn refresh(&mut self) { if !self.sid.is_empty() && is_active_and_seat0(&self.sid) { - // Wayland display and xauth may not be available in a short time after login. + // Xwayland display and xauth may not be available in a short time after login. if is_xwayland_running() && !self.is_login_wayland() { self.get_display_xauth_xwayland(); self.is_rustdesk_subprocess = false; From a233d28efc3a67e5ecda4e540c5da2993033e5e5 Mon Sep 17 00:00:00 2001 From: hms5232 <43672033+hms5232@users.noreply.github.com> Date: Sat, 7 Oct 2023 14:11:43 +0800 Subject: [PATCH 71/71] fix wrong terms in tw lang MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit quality is "品質" in Taiwan, the "質量" is used in China. --- src/lang/tw.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/tw.rs b/src/lang/tw.rs index 0074e8afb..dbe2c20e1 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -127,7 +127,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Optimize reaction time", "最佳化反應時間"), ("Custom", "自訂"), ("Show remote cursor", "顯示遠端游標"), - ("Show quality monitor", "顯示質量監測"), + ("Show quality monitor", "顯示品質監測"), ("Disable clipboard", "停用剪貼簿"), ("Lock after session end", "工作階段結束後鎖定電腦"), ("Insert", "插入"), @@ -445,7 +445,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Display", "顯示"), ("Default View Style", "預設顯示方式"), ("Default Scroll Style", "預設滾動方式"), - ("Default Image Quality", "預設圖像質量"), + ("Default Image Quality", "預設圖像品質"), ("Default Codec", "預設編解碼器"), ("Bitrate", "位元速率"), ("FPS", "幀率"),