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

@@ -5,7 +5,7 @@ use tauri::{Listener, Manager};
use crate::{
config::Config,
core::{handle, timer::Timer},
log_err, logging,
log_err, logging, logging_error,
utils::logging::Type,
AppHandleManager,
};
@@ -40,6 +40,10 @@ pub fn entry_lightweight_mode() {
let _ = cancel_light_weight_timer();
}
pub fn add_light_weight_timer() {
logging_error!(Type::Lightweight, setup_light_weight_timer());
}
fn setup_window_close_listener() -> u32 {
if let Some(window) = handle::Handle::global().get_window() {
let handler = window.listen("tauri://close-requested", move |_event| {