Skip to content

Commit

Permalink
Merge branch 'rustdesk:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangbo8418 authored Oct 18, 2024
2 parents 9c9398f + 0f6d28d commit 453cfb0
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
3 changes: 3 additions & 0 deletions flutter/lib/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3177,6 +3177,9 @@ importConfig(List<TextEditingController>? controllers, List<RxString>? errMsgs,
if (text != null && text.isNotEmpty) {
try {
final sc = ServerConfig.decode(text);
if (isWeb || isIOS) {
sc.relayServer = '';
}
if (sc.idServer.isNotEmpty) {
Future<bool> success = setServerConfig(controllers, errMsgs, sc);
success.then((value) {
Expand Down
12 changes: 12 additions & 0 deletions flutter/lib/mobile/pages/remote_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class _RemotePageState extends State<RemotePage> {

final TextEditingController _textController =
TextEditingController(text: initText);
// This timer is used to check the composing status of the soft keyboard.
// It is used for Android, Korean(and other similar) input method.
Timer? _composingTimer;

_RemotePageState(String id) {
initSharedStates(id);
Expand Down Expand Up @@ -104,6 +107,7 @@ class _RemotePageState extends State<RemotePage> {
_physicalFocusNode.dispose();
await gFFI.close();
_timer?.cancel();
_composingTimer?.cancel();
gFFI.dialogManager.dismissAll();
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: SystemUiOverlay.values);
Expand Down Expand Up @@ -139,6 +143,7 @@ class _RemotePageState extends State<RemotePage> {
gFFI.ffiModel.pi.version.isNotEmpty) {
gFFI.invokeMethod("enable_soft_keyboard", false);
}
_composingTimer?.cancel();
} else {
_timer?.cancel();
_timer = Timer(kMobileDelaySoftKeyboardFocus, () {
Expand Down Expand Up @@ -202,6 +207,13 @@ class _RemotePageState extends State<RemotePage> {
}

void _handleNonIOSSoftKeyboardInput(String newValue) {
_composingTimer?.cancel();
if (_textController.value.isComposingRangeValid) {
_composingTimer = Timer(Duration(milliseconds: 25), () {
_handleNonIOSSoftKeyboardInput(_textController.value.text);
});
return;
}
var oldValue = _value;
_value = newValue;
if (oldValue.isNotEmpty &&
Expand Down
21 changes: 21 additions & 0 deletions flutter/lib/models/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,27 @@ class ImageModel with ChangeNotifier {

clearImage() => _image = null;

bool _webDecodingRgba = false;
final List<Uint8List> _webRgbaList = List.empty(growable: true);
webOnRgba(int display, Uint8List rgba) async {
// deep copy needed, otherwise "instantiateCodec failed: TypeError: Cannot perform Construct on a detached ArrayBuffer"
_webRgbaList.add(Uint8List.fromList(rgba));
if (_webDecodingRgba) {
return;
}
_webDecodingRgba = true;
try {
while (_webRgbaList.isNotEmpty) {
final rgba2 = _webRgbaList.last;
_webRgbaList.clear();
await decodeAndUpdate(display, rgba2);
}
} catch (e) {
debugPrint('onRgba error: $e');
}
_webDecodingRgba = false;
}

onRgba(int display, Uint8List rgba) async {
try {
await decodeAndUpdate(display, rgba);
Expand Down
10 changes: 5 additions & 5 deletions src/lang/es.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,10 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("one-way-file-transfer-tip", "La transferencia en un sentido está habilitada en el lado controlado."),
("Authentication Required", "Se requiere autenticación"),
("Authenticate", "Autenticar"),
("web_id_input_tip", ""),
("Download", ""),
("Upload folder", ""),
("Upload files", ""),
("Clipboard is synchronized", ""),
("web_id_input_tip", "Puedes introducir una ID en el mismo servidor, el cliente web no soporta acceso vía IP.\nSi quieres acceder a un dispositivo en otro servidor, por favor, agrega la dirección del servidor (<id>@<direccion_servidor>?clave=<clave_valor>), por ejemplo,\n[email protected]:21117?key=5Qbwsde3unUcJBtrx9ZkvUmwFNoExHzpryHuPUdqlWM=.\nSi quieres accedder a un dispositivo en un servidor público, por favor, introduce \"<id>@public\", la clave no es necesaria para el servidor público."),
("Download", "Descarga"),
("Upload folder", "Subir carpeta"),
("Upload files", "Subir archivos"),
("Clipboard is synchronized", "Portapapeles sincronizado"),
].iter().cloned().collect();
}

0 comments on commit 453cfb0

Please sign in to comment.