mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-28 09:12:08 +08:00
fix(macOS): early setup macOS activation policy (#7246)
* fix(macOS): early setup of macOS activation policy * refactor --------- Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
This commit is contained in:
@@ -50,6 +50,8 @@ pub fn resolve_setup_async() {
|
||||
AsyncHandler::spawn(|| async {
|
||||
logging!(info, Type::ClashVergeRev, "Version: {}", env!("CARGO_PKG_VERSION"));
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
resolve_dock_show().await;
|
||||
init_startup_script().await;
|
||||
init_verge_config().await;
|
||||
Config::verify_config_initialization().await;
|
||||
@@ -198,12 +200,15 @@ pub(super) async fn refresh_tray_menu() {
|
||||
|
||||
pub(super) async fn init_window() {
|
||||
let is_silent_start = Config::verge().await.data_arc().enable_silent_start.unwrap_or(false);
|
||||
#[cfg(target_os = "macos")]
|
||||
WindowManager::create_window(!is_silent_start).await;
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub(super) async fn resolve_dock_show() {
|
||||
let is_silent_start = Config::verge().await.data_arc().enable_silent_start.unwrap_or(false);
|
||||
if is_silent_start {
|
||||
use crate::core::handle::Handle;
|
||||
Handle::global().set_activation_policy_accessory();
|
||||
}
|
||||
WindowManager::create_window(!is_silent_start).await;
|
||||
}
|
||||
|
||||
pub fn resolve_done() {
|
||||
|
||||
Reference in New Issue
Block a user