Faster unchanged polls; orphan-core cleanup on listen ports; clearer busy-port errors; cores only from binDir; incremental server list; CSP without Google Fonts; single-instance activates existing window; close-to-tray without kill-others or balloon. Co-authored-by: Cursor <cursoragent@cursor.com>
43 lines
762 B
Go
43 lines
762 B
Go
//go:build darwin
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"os"
|
|
"os/exec"
|
|
"syscall"
|
|
|
|
"github.com/crgimenes/glaze"
|
|
)
|
|
|
|
func openExternal(raw string) error {
|
|
return exec.Command("open", raw).Start()
|
|
}
|
|
|
|
func fatalf(format string, args ...any) {
|
|
msg := fmt.Sprintf(format, args...)
|
|
log.Println(msg)
|
|
_ = exec.Command("osascript", "-e", fmt.Sprintf(`display alert "Navis" message %q`, msg)).Run()
|
|
os.Exit(1)
|
|
}
|
|
|
|
func shutdownSignals() []os.Signal {
|
|
return []os.Signal{os.Interrupt, syscall.SIGTERM}
|
|
}
|
|
|
|
func decorateWindow(w glaze.WebView, hideOnClose bool) {
|
|
// macOS Dock/app icon comes from the .app bundle; close-to-hide is Windows-only.
|
|
_ = w
|
|
_ = hideOnClose
|
|
}
|
|
|
|
func showMainWindow() {}
|
|
|
|
func prepareWindowQuit() {}
|
|
|
|
func closeMainWindow() {
|
|
os.Exit(0)
|
|
}
|