diff --git a/mac/Sources/Wind/AppDelegate.swift b/mac/Sources/Wind/AppDelegate.swift index b4d7f849..4ec1a133 100644 --- a/mac/Sources/Wind/AppDelegate.swift +++ b/mac/Sources/Wind/AppDelegate.swift @@ -60,6 +60,16 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate { !c.onboarded || !accessibility || (c.engine == "draw" && !screenRecording) } + /// Opening Wind again while it runs (Spotlight, Finder, the Dock, `open -a Wind`) shows Settings: + /// a menu-bar agent has no window for macOS to bring forward, so the reopen did nothing before. + func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool { + let setup = AppDelegate.needsSetup(mag.config, accessibility: AXIsProcessTrusted(), + screenRecording: CGPreflightScreenCaptureAccess()) + Log.info("reopened: showing \(setup ? "setup" : "Settings")") + showSettings(onboard: setup) + return false + } + func applicationWillTerminate(_ n: Notification) { mag.stop() HIDGain.shared.restoreNow() diff --git a/mac/VERSION b/mac/VERSION index d3532a10..659914ae 100644 --- a/mac/VERSION +++ b/mac/VERSION @@ -1 +1 @@ -0.5.7 +0.5.8 diff --git a/mac/docs/architecture.md b/mac/docs/architecture.md index 0e41c214..9a6fb8a0 100644 --- a/mac/docs/architecture.md +++ b/mac/docs/architecture.md @@ -1078,6 +1078,8 @@ caret following off. Each Tab must move the view onto the focused button; passes ## Settings window (2026-11-01) Spec and plan: `~/Documents/Claude/research/wind-mac/2026-11-01-settings-port-spec-plan.md`. +- **Opening Wind again** while it runs (Spotlight, Finder, `open -a Wind`) opens this window, or the + setup when `needsSetup` holds (`applicationShouldHandleReopen`, 0.5.8). - **Page:** `ui/` is Windows Wind's Svelte settings UI (copied at Wind commit `982e162`, see `ui/README.md`), adapted for the Mac. `scripts/build.sh` builds `ui/dist` and bundles it as `Wind.app/Contents/Resources/ui`.