Repository navigation
fix: 移除 SwiftUI App 壳改纯 AppKit 入口,根除自制构建空白设置窗 - #23
Merged
freestylefly merged 1 commit intoOct 2, 2026
Merged
Conversation
唯一的 SwiftUI scene 是占位 Settings { EmptyView() },正常不可达,但
ad-hoc 自制构建冷启动时被 macOS 状态恢复成空白设置窗(Developer ID
构建不弹,已实验隔离)。窗口本就全由 AppKit 控制器自管,SwiftUI App
壳是多余依赖——改纯 AppKit 入口后没有 scene 就没有恢复对象。
SwiftUI App 运行时曾隐式合成默认主菜单,纯入口下键盘等价会失去路由:
设置窗文本框的撤销/拷贝/粘贴/全选、关窗、退出与隐藏。入口处按 AppKit
模板重建最小标准主菜单补齐对等,菜单标题走 L10n 双语。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #22
改动
@main从 SwiftUIApp壳(唯一 scene 是占位Settings { EmptyView() })迁到AppDelegate.static main()(标准纯 AppKit 模板:NSApplication.shared→ 设 delegate →makeMainMenu()→run());窗口本就全由 AppKit 控制器自管,壳是多余依赖,且正是它被 ad-hoc 构建的状态恢复复活成空白窗(见 自制 ad-hoc 构建冷启动弹空白「设置」窗(占位 Settings scene 被状态恢复复活) #22 定位)。delegate常量在run()阻塞期间强持有,抵消app.delegate的 weak。验证
swift test151/0 全绿(与纯 main 基线逐数一致,用干净树对照过);