fix, compilation

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-11-29 01:42:44 -05:00
parent 4cbbb5b64f
commit 7a2590d1f9
2 changed files with 22 additions and 21 deletions

View File

@ -1603,7 +1603,6 @@ class _KeyboardMenu extends StatelessWidget {
menuChildren: [ menuChildren: [
keyboardMode(modeOnly), keyboardMode(modeOnly),
localKeyboardType(), localKeyboardType(),
Divider(),
inputSource(), inputSource(),
Divider(), Divider(),
viewMode(), viewMode(),
@ -1693,8 +1692,8 @@ class _KeyboardMenu extends StatelessWidget {
if (supportedInputSourceList.length < 2) return Offstage(); if (supportedInputSourceList.length < 2) return Offstage();
final inputSource = stateGlobal.getInputSource(); final inputSource = stateGlobal.getInputSource();
final enabled = !ffi.ffiModel.viewOnly; final enabled = !ffi.ffiModel.viewOnly;
return Column( final children = <Widget>[Divider()];
children: supportedInputSourceList.map((e) { children.addAll(supportedInputSourceList.map((e) {
final d = e as List<dynamic>; final d = e as List<dynamic>;
return RdoMenuButton<String>( return RdoMenuButton<String>(
child: Text(translate(d[1] as String)), child: Text(translate(d[1] as String)),
@ -1710,8 +1709,8 @@ class _KeyboardMenu extends StatelessWidget {
: null, : null,
ffi: ffi, ffi: ffi,
); );
}).toList(), }));
); return Column(children: children);
} }
viewMode() { viewMode() {

View File

@ -12,7 +12,7 @@ use hbb_common::message_proto::*;
#[cfg(any(target_os = "windows", target_os = "macos"))] #[cfg(any(target_os = "windows", target_os = "macos"))]
use rdev::KeyCode; use rdev::KeyCode;
use rdev::{Event, EventType, Key}; 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::sync::atomic::{AtomicBool, Ordering};
use std::{ use std::{
collections::HashMap, collections::HashMap,
@ -324,7 +324,7 @@ pub fn stop_grab_loop() -> Result<(), rdev::GrabError> {
#[cfg(any(target_os = "windows", target_os = "macos"))] #[cfg(any(target_os = "windows", target_os = "macos"))]
rdev::exit_grab()?; rdev::exit_grab()?;
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
rdev::exit_grab_listen()?; rdev::exit_grab_listen();
Ok(()) Ok(())
} }
@ -1082,6 +1082,8 @@ pub fn keycode_to_rdev_key(keycode: u32) -> Key {
#[cfg(not(any(target_os = "android", target_os = "ios")))] #[cfg(not(any(target_os = "android", target_os = "ios")))]
pub mod input_source { pub mod input_source {
use hbb_common::SessionID; use hbb_common::SessionID;
#[cfg(target_os = "macos")]
use hbb_common::log;
use crate::ui_interface::{get_local_option, set_local_option}; use crate::ui_interface::{get_local_option, set_local_option};