fix: macos use hotkey closing window can not entry auto-lightweight-mode #3326

This commit is contained in:
Tunglies
2025-04-12 03:27:21 +08:00
parent 51ef1329be
commit 1970155c51
4 changed files with 18 additions and 4 deletions

View File

@@ -109,10 +109,21 @@ pub fn quit() {
#[cfg(target_os = "macos")]
pub fn hide() {
use crate::module::lightweight::add_light_weight_timer;
let enable_auto_light_weight_mode = Config::verge()
.data()
.enable_auto_light_weight_mode
.unwrap_or(false);
if enable_auto_light_weight_mode {
add_light_weight_timer();
}
if let Some(window) = handle::Handle::global().get_window() {
if window.is_visible().unwrap_or(false) {
AppHandleManager::global().set_activation_policy_accessory();
let _ = window.hide();
}
}
AppHandleManager::global().set_activation_policy_accessory();
}