Skip to content

fix(mac): stop opening an empty settings window at launch - #94

Merged
dcolinmorgan merged 2 commits into
dcolinmorgan:mainfrom
null1979:pr/mac-no-settings-window
Oct 19, 2026
Merged

dcolinmorgan merged 2 commits into
dcolinmorgan:mainfrom
null1979:pr/mac-no-settings-window

Conversation

@null1979

@null1979 null1979 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Change: the Settings { EmptyView() } scene gets .defaultLaunchBehavior(.suppressed), so macOS no longer opens it at launch.

Why: on macOS 26.7.1, every launch of Herdi opens an empty 900×450 "Herdi Settings" window. A v0.8.0 build does the same, so the bug is older than the recent Herdi changes. There is no saved window state behind it. SwiftUI opens the lone Settings scene by itself.

macOS 14: defaultLaunchBehavior needs macOS 15, and a SceneBuilder takes if #available with no else. So macOS 14 gets no scene. The panel and the status item are AppKit and do not use it. I simulated that case on macOS 26 by changing the check to an OS that does not exist. The panel and the status menu worked. I could not test it on a real macOS 14 machine.

Older SDKs: the CI runner (macos-14, Xcode 15) has no defaultLaunchBehavior. A #if compiler(>=6.0) check keeps the plain scene there, so the code compiles, but such a build still opens the window. Swift 6 ships with the macOS 15 SDK.

Not used: a hidden MenuBarExtra also stops the window, but do not take that route. It takes the status-item slot Item-0, and macOS saves it as hidden in the com.dcolinmorgan.herdi defaults. Herdi's own icon uses that slot, so the icon disappears, also in builds without the change.

Test: herdi-mac/build.sh and herdi-mac/test.sh pass. Over several launches, Herdi opens only the notch panel. The status icon shows, the menu toggles work, and the defaults are the same before and after a run.

@dcolinmorgan
dcolinmorgan merged commit 3c3e65c into dcolinmorgan:main Oct 19, 2026
3 checks passed
@null1979
null1979 deleted the pr/mac-no-settings-window branch October 20, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants