Fix windows compile error

This commit is contained in:
Asura 2022-09-07 16:57:27 +08:00
parent f1c8b59a91
commit 4d3fa6955b
3 changed files with 36 additions and 15 deletions

View File

@ -49,7 +49,7 @@ packages:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.9.0" version: "2.8.2"
back_button_interceptor: back_button_interceptor:
dependency: "direct main" dependency: "direct main"
description: description:
@ -147,7 +147,7 @@ packages:
name: characters name: characters
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.1" version: "1.2.0"
charcode: charcode:
dependency: transitive dependency: transitive
description: description:
@ -168,7 +168,7 @@ packages:
name: clock name: clock
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.1" version: "1.1.0"
code_builder: code_builder:
dependency: transitive dependency: transitive
description: description:
@ -324,7 +324,7 @@ packages:
name: fake_async name: fake_async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.1" version: "1.3.0"
ffi: ffi:
dependency: "direct main" dependency: "direct main"
description: description:
@ -621,14 +621,14 @@ packages:
name: matcher name: matcher
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.12.12" version: "0.12.11"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.1.5" version: "0.1.4"
menu_base: menu_base:
dependency: transitive dependency: transitive
description: description:
@ -642,7 +642,7 @@ packages:
name: meta name: meta
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0" version: "1.7.0"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -719,7 +719,7 @@ packages:
name: path name: path
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.2" version: "1.8.1"
path_provider: path_provider:
dependency: "direct main" dependency: "direct main"
description: description:
@ -971,7 +971,7 @@ packages:
name: source_span name: source_span
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.9.0" version: "1.8.2"
sqflite: sqflite:
dependency: transitive dependency: transitive
description: description:
@ -1013,7 +1013,7 @@ packages:
name: string_scanner name: string_scanner
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.1.1" version: "1.1.0"
synchronized: synchronized:
dependency: transitive dependency: transitive
description: description:
@ -1027,14 +1027,14 @@ packages:
name: term_glyph name: term_glyph
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.1" version: "1.2.0"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.4.12" version: "0.4.9"
timing: timing:
dependency: transitive dependency: transitive
description: description:

View File

@ -58,6 +58,27 @@ lazy_static::lazy_static! {
struct UIHostHandler; struct UIHostHandler;
fn check_connect_status(
reconnect: bool,
) -> (
Arc<Mutex<Status>>,
Arc<Mutex<HashMap<String, String>>>,
mpsc::UnboundedSender<ipc::Data>,
Arc<Mutex<String>>,
) {
let status = Arc::new(Mutex::new((0, false, 0, "".to_owned())));
let options = Arc::new(Mutex::new(Config::get_options()));
let cloned = status.clone();
let cloned_options = options.clone();
let (tx, rx) = mpsc::unbounded_channel::<ipc::Data>();
let password = Arc::new(Mutex::new(String::default()));
let cloned_password = password.clone();
std::thread::spawn(move || {
crate::ui_interface::check_connect_status_(reconnect, rx)
});
(status, options, tx, password)
}
pub fn start(args: &mut [String]) { pub fn start(args: &mut [String]) {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
if args.len() == 1 && args[0] == "--server" { if args.len() == 1 && args[0] == "--server" {
@ -86,7 +107,7 @@ pub fn start(args: &mut [String]) {
} }
#[cfg(windows)] #[cfg(windows)]
if args.len() > 0 && args[0] == "--tray" { if args.len() > 0 && args[0] == "--tray" {
let options = crate::ui_interface::check_connect_status(false).1; let options = check_connect_status(false).1;
crate::tray::start_tray(options); crate::tray::start_tray(options);
return; return;
} }

View File

@ -69,7 +69,7 @@ pub fn goto_install() {
allow_err!(crate::run_me(vec!["--install"])); allow_err!(crate::run_me(vec!["--install"]));
} }
pub fn install_me(_options: String, _path: String, _silent: bool, _debug: bool) { pub fn install_me(_options: String, _path: String, silent: bool, debug: bool) {
#[cfg(windows)] #[cfg(windows)]
std::thread::spawn(move || { std::thread::spawn(move || {
allow_err!(crate::platform::windows::install_me( allow_err!(crate::platform::windows::install_me(
@ -715,7 +715,7 @@ pub(crate) fn check_connect_status(reconnect: bool) -> mpsc::UnboundedSender<ipc
// notice: avoiding create ipc connecton repeatly, // notice: avoiding create ipc connecton repeatly,
// because windows named pipe has serious memory leak issue. // because windows named pipe has serious memory leak issue.
#[tokio::main(flavor = "current_thread")] #[tokio::main(flavor = "current_thread")]
async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc::Data>) { pub(crate) async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc::Data>) {
let mut key_confirmed = false; let mut key_confirmed = false;
let mut rx = rx; let mut rx = rx;
let mut mouse_time = 0; let mut mouse_time = 0;