fix: refine macOS authentication app lifecycle

This commit is contained in:
Kevin Yue committed 2026-08-06 10:59:56 +08:00
1 parent 588790f2d5
commit 17d1555155
5 files changed
+38 -8

No files matched your search

+10
View File
@@ -8,6 +8,8 @@ use gpapi::{
utils::{redact::redact_uri, window::get_title_bar_height},
};
use log::{info, warn};
#[cfg(target_os = "macos")]
use tauri::Manager;
use tauri::{
AppHandle, WebviewUrl, WebviewWindow, WindowEvent,
webview::{PageLoadEvent, PageLoadPayload},
@@ -318,6 +320,14 @@ impl<'a> WebviewAuthenticator<'a> {
info!("Raising auth window...");
#[cfg(target_os = "macos")]
if let Err(err) = auth_window
.app_handle()
.set_activation_policy(tauri::ActivationPolicy::Regular)
{
warn!("Failed to show the application in the Dock: {}", err);
}
use gpapi::utils::window::WindowExt;
let result = auth_window.raise();