//go:build darwin package main // There is no tray on macOS, and that is a decision rather than an omission. // // macOS has exactly ONE main run loop and AppKit insists that windows and // status items are created on it. Wails already owns that loop. Two attempts, // both crashing within a second of launch: // // systray.Run -> SIGTRAP inside cgo: nativeLoop() takes the // main loop for itself, and Wails has it // systray.RunWithExternalLoop -> "NSWindow should only be instantiated on // the main thread!" - it registers in the // existing NSApplication but still builds // AppKit objects, and Wails' OnStartup is not // the main thread // // Making it work needs the status item created through a main-queue dispatch // inside Wails' own lifecycle, which is real work for a build whose entire // purpose is demoing on a developer's Mac. Windows is the platform this ships // to and its tray is the shop manager's only control surface; here the window // is right there in the Dock. // // The consequence is handled rather than left: with no tray there would be no // way back from a hidden window and no way to quit, so on macOS closing the // window stops the engine and exits. See main.go. func startSystray(onReady func()) {}