fix(client/macos): 最小化托盘后点 Dock 图标唤回窗口(1.0.48+49)
windowManager.hide() 走 orderOut: 后主窗口不可见,点 Dock 图标系统只发 applicationShouldHandleReopen(hasVisibleWindows=false),AppDelegate 未接管 → 点了没反应。AppDelegate 实现该回调,无可见窗口时 makeKeyAndOrderFront + activate 唤回 mainFlutterWindow。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -12,4 +12,14 @@ class AppDelegate: FlutterAppDelegate {
|
||||
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// 隐藏到托盘后点 Dock 图标 → 唤回主窗口。窗口被 window_manager.hide()(orderOut:)
|
||||
// 隐藏时 hasVisibleWindows=false,系统只发 reopen 事件、不会自动显示;不接管就"点了没反应"。
|
||||
override func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
|
||||
if !flag {
|
||||
mainFlutterWindow?.makeKeyAndOrderFront(nil)
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
name: pangolin_vpn
|
||||
description: 穿山甲 · Pangolin — 极简、稳定、跨平台网络加速客户端。
|
||||
publish_to: "none"
|
||||
version: 1.0.47+48
|
||||
version: 1.0.48+49
|
||||
|
||||
environment:
|
||||
sdk: ^3.5.0
|
||||
|
||||
Reference in New Issue
Block a user