Merge pull request #3544 from Heap-Hop/master

Fix Android bugs
This commit is contained in:
RustDesk 2023-03-08 10:54:52 +08:00 committed by GitHub
commit 8d816ee0e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 3 deletions

View File

@ -368,7 +368,7 @@ class MyTheme {
static void changeDarkMode(ThemeMode mode) async {
Get.changeThemeMode(mode);
if (desktopType == DesktopType.main) {
if (desktopType == DesktopType.main || isAndroid || isIOS) {
if (mode == ThemeMode.system) {
await bind.mainSetLocalOption(key: kCommConfKeyTheme, value: '');
} else {

View File

@ -14,7 +14,10 @@ const String kPeerPlatformAndroid = "Android";
/// [kAppTypeMain] used by 'Desktop Main Page' , 'Mobile (Client and Server)', "Install Page"
const String kAppTypeMain = "main";
/// [kAppTypeConnectionManager] only for 'Desktop CM Page'
const String kAppTypeConnectionManager = "cm";
const String kAppTypeDesktopRemote = "remote";
const String kAppTypeDesktopFileTransfer = "file transfer";
const String kAppTypeDesktopPortForward = "port forward";

View File

@ -263,8 +263,11 @@ class ServerModel with ChangeNotifier {
toggleInput() {
if (_inputOk) {
parent.target?.invokeMethod("stop_input");
bind.mainSetOption(key: "enable-keyboard", value: 'N');
} else {
if (parent.target != null) {
/// the result of toggle-on depends on user actions in the settings page.
/// handle result, see [ServerModel.changeStatue]
showInputWarnAlert(parent.target!);
}
}

View File

@ -26,8 +26,14 @@ use std::{
sync::{Arc, RwLock},
};
/// tag "main" for [Desktop Main Page] and [Mobile (Client and Server)] (the mobile don't need multiple windows, only one global event stream is needed)
/// tag "cm" only for [Desktop CM Page]
pub(super) const APP_TYPE_MAIN: &str = "main";
#[cfg(not(any(target_os = "android", target_os = "ios")))]
pub(super) const APP_TYPE_CM: &str = "cm";
#[cfg(any(target_os = "android", target_os = "ios"))]
pub(super) const APP_TYPE_CM: &str = "main";
pub(super) const APP_TYPE_DESKTOP_REMOTE: &str = "remote";
pub(super) const APP_TYPE_DESKTOP_FILE_TRANSFER: &str = "file transfer";
pub(super) const APP_TYPE_DESKTOP_PORT_FORWARD: &str = "port forward";

View File

@ -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", "跟随系统"),

View File

@ -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", "跟隨系統"),