mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-18 08:21:34 +08:00
refactor: move handle_window_destroyed function under macOS conditional compilation
This commit is contained in:
parent
966693c9cb
commit
04fc9640c6
@ -351,9 +351,8 @@ pub fn run() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn handle_window_destroyed() {
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
{
|
pub fn handle_window_destroyed() {
|
||||||
use crate::core::hotkey::SystemHotkey;
|
use crate::core::hotkey::SystemHotkey;
|
||||||
AsyncHandler::spawn(move || async move {
|
AsyncHandler::spawn(move || async move {
|
||||||
let _ = hotkey::Hotkey::global().unregister_system_hotkey(SystemHotkey::CmdQ);
|
let _ = hotkey::Hotkey::global().unregister_system_hotkey(SystemHotkey::CmdQ);
|
||||||
@ -369,7 +368,6 @@ pub fn run() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "clippy")]
|
#[cfg(feature = "clippy")]
|
||||||
let context = tauri::test::mock_context(tauri::test::noop_assets());
|
let context = tauri::test::mock_context(tauri::test::noop_assets());
|
||||||
@ -447,6 +445,7 @@ pub fn run() {
|
|||||||
tauri::WindowEvent::Focused(focused) => {
|
tauri::WindowEvent::Focused(focused) => {
|
||||||
event_handlers::handle_window_focus(focused);
|
event_handlers::handle_window_focus(focused);
|
||||||
}
|
}
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
tauri::WindowEvent::Destroyed => {
|
tauri::WindowEvent::Destroyed => {
|
||||||
event_handlers::handle_window_destroyed();
|
event_handlers::handle_window_destroyed();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user