diff --git a/src/common.rs b/src/common.rs index 2e772118c..137352052 100644 --- a/src/common.rs +++ b/src/common.rs @@ -712,7 +712,6 @@ pub fn make_fd_flutter(id: i32, entries: &Vec, only_count: bool) -> S serde_json::to_string(&m).unwrap_or("".into()) } - pub fn get_keyboard_mode() -> String { return std::env::var("KEYBOARD_MODE") .unwrap_or(String::from("legacy")) @@ -723,11 +722,13 @@ pub fn save_keyboard_mode(value: String) { std::env::set_var("KEYBOARD_MODE", value); } +#[cfg(not(target_os = "linux"))] lazy_static::lazy_static! { - pub static ref IS_X11: Mutex = { - #[cfg(target_os = "linux")] - Mutex::new("x11" == hbb_common::platform::linux::get_display_server()); - #[cfg(not(target_os = "linux"))] - Mutex::new(false) - }; -} \ No newline at end of file + pub static ref IS_X11: Mutex = Mutex::new(false); + +} + +#[cfg(target_os = "linux")] +lazy_static::lazy_static! { + pub static ref IS_X11: Mutex = Mutex::new("x11" == hbb_common::platform::linux::get_display_server()); +}