Skip to content

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

fix, compilation

fufesou7a2590d1f901
diff --git a/flutter/lib/desktop/widgets/remote_toolbar.dart b/flutter/lib/desktop/widgets/remote_toolbar.dart
index bc28f637a..e38aa9546 100644
--- a/flutter/lib/desktop/widgets/remote_toolbar.dart
+++ b/flutter/lib/desktop/widgets/remote_toolbar.dart
@@ -1603,7 +1603,6 @@ class _KeyboardMenu extends StatelessWidget {
menuChildren: [
keyboardMode(modeOnly),
localKeyboardType(),
- Divider(),
inputSource(),
Divider(),
viewMode(),
@@ -1693,25 +1692,25 @@ class _KeyboardMenu extends StatelessWidget {
if (supportedInputSourceList.length < 2) return Offstage();
final inputSource = stateGlobal.getInputSource();
final enabled = !ffi.ffiModel.viewOnly;
- return Column(
- children: supportedInputSourceList.map((e) {
- final d = e as List<dynamic>;
- return RdoMenuButton<String>(
- child: Text(translate(d[1] as String)),
- value: d[0] as String,
- groupValue: inputSource,
- onChanged: enabled
- ? (v) async {
- if (v != null) {
- await stateGlobal.setInputSource(ffi.sessionId, v);
- await ffi.ffiModel.checkDesktopKeyboardMode();
- }
+ final children = <Widget>[Divider()];
+ children.addAll(supportedInputSourceList.map((e) {
+ final d = e as List<dynamic>;
+ return RdoMenuButton<String>(
+ child: Text(translate(d[1] as String)),
+ value: d[0] as String,
+ groupValue: inputSource,
+ onChanged: enabled
+ ? (v) async {
+ if (v != null) {
+ await stateGlobal.setInputSource(ffi.sessionId, v);
+ await ffi.ffiModel.checkDesktopKeyboardMode();
}
- : null,
- ffi: ffi,
- );
- }).toList(),
- );
+ }
+ : null,
+ ffi: ffi,
+ );
+ }));
+ return Column(children: children);
}
viewMode() {
diff --git a/src/keyboard.rs b/src/keyboard.rs
index b98afacc0..db5cc132d 100644
--- a/src/keyboard.rs
+++ b/src/keyboard.rs
@@ -12,7 +12,7 @@ use hbb_common::message_proto::*;
#[cfg(any(target_os = "windows", target_os = "macos"))]
use rdev::KeyCode;
use rdev::{Event, EventType, Key};
-#[cfg(any(target_os = "windows", target_os = "macos"))]
+#[cfg(not(any(target_os = "android", target_os = "ios")))]
use std::sync::atomic::{AtomicBool, Ordering};
use std::{
collections::HashMap,
@@ -324,7 +324,7 @@ pub fn stop_grab_loop() -> Result<(), rdev::GrabError> {
#[cfg(any(target_os = "windows", target_os = "macos"))]
rdev::exit_grab()?;
#[cfg(target_os = "linux")]
- rdev::exit_grab_listen()?;
+ rdev::exit_grab_listen();
Ok(())
}
@@ -1082,6 +1082,8 @@ pub fn keycode_to_rdev_key(keycode: u32) -> Key {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
pub mod input_source {
use hbb_common::SessionID;
+ #[cfg(target_os = "macos")]
+ use hbb_common::log;
use crate::ui_interface::{get_local_option, set_local_option};