From d9b96d2f3167b8ea6f4e2bc268bfed0fa7457825 Mon Sep 17 00:00:00 2001 From: fufesou Date: Thu, 9 May 2024 11:13:35 +0800 Subject: [PATCH] fix: build (#7989) Signed-off-by: fufesou --- src/flutter_ffi.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/flutter_ffi.rs b/src/flutter_ffi.rs index 7ec245b28..073389d0d 100644 --- a/src/flutter_ffi.rs +++ b/src/flutter_ffi.rs @@ -913,20 +913,24 @@ pub fn main_set_local_option(key: String, value: String) { // // 1. For get, the value is stored in the server process. // 2. For clear, we need to need to return the error mmsg from the server process to flutter. -#[cfg(target_os = "linux")] -pub fn main_handle_wayland_screencast_restore_token(key: String, value: String) -> String { - if value == "get" { - match crate::ipc::get_wayland_screencast_restore_token(key) { +pub fn main_handle_wayland_screencast_restore_token(_key: String, _value: String) -> String { + #[cfg(not(target_os = "linux"))] + { + return "".to_owned(); + } + #[cfg(target_os = "linux")] + if _value == "get" { + match crate::ipc::get_wayland_screencast_restore_token(_key) { Ok(v) => v, Err(e) => { log::error!("Failed to get wayland screencast restore token, {}", e); "".to_owned() } } - } else if value == "clear" { - match crate::ipc::clear_wayland_screencast_restore_token(key.clone()) { + } else if _value == "clear" { + match crate::ipc::clear_wayland_screencast_restore_token(_key.clone()) { Ok(true) => { - set_local_option(key, "".to_owned()); + set_local_option(_key, "".to_owned()); "".to_owned() } Ok(false) => "Failed to clear, please try again.".to_owned(), @@ -935,11 +939,7 @@ pub fn main_handle_wayland_screencast_restore_token(key: String, value: String) } else { "".to_owned() } -} - -#[cfg(not(target_os = "linux"))] -pub fn main_handle_wayland_screencast_restore_token(_key: String, _value: String) -> String { - "".to_owned() + } pub fn main_get_input_source() -> SyncReturn {