Try fix, click tray icon, run main window (#7540)
* Try fix, click tray icon, run main window Signed-off-by: fufesou <shuanglongchen@yeah.net> * Remove start uni link on Windows, use 'run_me' instead Signed-off-by: fufesou <shuanglongchen@yeah.net> --------- Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
22356940d9
commit
810b980e6b
22
src/tray.rs
22
src/tray.rs
@ -88,14 +88,20 @@ pub fn make_tray() -> hbb_common::ResultType<()> {
|
|||||||
crate::platform::macos::handle_application_should_open_untitled_file();
|
crate::platform::macos::handle_application_should_open_untitled_file();
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
{
|
{
|
||||||
use std::os::windows::process::CommandExt;
|
// Do not use the follwoing code (start uni link).
|
||||||
use std::process::Command;
|
// It may be unable to open the app on some machines.
|
||||||
Command::new("cmd")
|
// eg. crate::get_uri_prefix() has some special characters or non-ascii characters.
|
||||||
.arg("/c")
|
//
|
||||||
.arg(&format!("start {}", crate::get_uri_prefix()))
|
// Command::new("cmd")
|
||||||
.creation_flags(winapi::um::winbase::CREATE_NO_WINDOW)
|
// .arg("/c")
|
||||||
.spawn()
|
// .arg(&format!("start {}", crate::get_uri_prefix()))
|
||||||
.ok();
|
// .creation_flags(winapi::um::winbase::CREATE_NO_WINDOW)
|
||||||
|
// .spawn()
|
||||||
|
// .ok();
|
||||||
|
|
||||||
|
// Use `run_me` instead.
|
||||||
|
// `allow_multiple_instances` in `flutter/windows/runner/main.cpp` allows only one instance without args.
|
||||||
|
crate::run_me::<&str>(vec![]).ok();
|
||||||
}
|
}
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
if !std::process::Command::new("xdg-open")
|
if !std::process::Command::new("xdg-open")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user