Skip to content

[Upstream #2045][macOS] 菜單列圖示位置在退出後無法保存 #25

Description

@SingLinkNetwork

來源與現象

  • 上游問題:chen08209/FlClash#2045
  • 上游提出的修復 PR:chen08209/FlClash#2247,目前仍未合併。
  • 環境:macOS Tahoe 26.5、FlClash 0.8.92。
  • 重現:手動拖曳 FlClash 菜單列圖示到新位置,正常退出後重新啟動,圖示回到最左側。
  • 上游留言以 macOS 設定值確認:退出前存在 NSStatusItem Preferred Position Item-0,FlClash 退出時該值被刪除;手動寫回後可以暫時保留,但再次正常退出仍會被刪除。

程式稽核

本 fork 的 lib/common/tray.dart 在退出流程中呼叫 trayManager.destroy()。macOS 的 NSStatusItem 被銷毀後,系統保存的菜單列位置也會被清除;上游 PR #2247 建議 macOS 退出時提早返回。Windows/Linux 仍需要保留原本的 destroy 行為。

修復方向

  • macOS 退出時不要呼叫 trayManager.destroy(),讓系統在程序退出時保留狀態列項目的位置資料。
  • Windows/Linux 維持原本的托盤銷毀行為。
  • 增加可測試的跨平台判斷與回歸測試,防止日後重新在 macOS 退出時銷毀狀態列項目。
  • 透過 macOS Intel CI、其他平台建置與完整測試驗證。

驗收標準

  • macOS 退出路徑不呼叫 trayManager.destroy()。
  • Windows/Linux 退出路徑仍呼叫 trayManager.destroy()。
  • 回歸測試通過。
  • Dart 測試、分析、macOS Intel 建置與完整 GitHub Actions 通過。
  • 限制:目前沒有 macOS Tahoe 實機可在 GUI 中拖曳圖示並重啟確認位置保存,不能宣稱完成真實菜單列人工驗證。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions