mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 06:26:14 -05:00
fix: refine macOS authentication app lifecycle
This commit is contained in:
5 files changed
+38
-8
No files matched your search
@@ -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();
|
||||
|
||||
|
||||
Reference in new issue
Block a user