Files
wisp-open/internal/ui/tray/tray_start_nonlinux.go
Your Name ce49f66c89 fix: Add cross-platform handling for tray, updater, and icon generation
- Add platform notes for tray startup, shortcut saving, and Linux-only settings
- Handle stat error in processRecording (missing file)
- Select correct binary name based on OS in updater
- Increase tray icon canvas size from 64 to 128 pixels
- Update frontend dist asset hash
2026-06-09 15:14:30 -07:00

32 lines
1.0 KiB
Go

//go:build !linux
// ============================================================
// WINDOWS-ONLY FILE — Tray startup for Windows (and macOS).
// Uses systray.Run which blocks and runs the Win32 message pump.
// The Linux equivalent is tray_start_linux.go which uses
// systray.Register to integrate with the existing GTK loop.
// ============================================================
package tray
import (
"runtime"
"github.com/getlantern/systray"
)
// Start initializes and runs the system tray.
// This function blocks until the tray is terminated.
func Start(app App) {
// Pin this goroutine to one OS thread for the whole lifetime of systray.Run.
// getlantern/systray creates the notify icon and runs the Win32 message pump on
// whichever thread calls Run; if the goroutine migrates between threads, callbacks
// and the tray context menu break until restart (often seen after sleep/resume).
runtime.LockOSThread()
defer runtime.UnlockOSThread()
systray.Run(
func() { onReady(app) },
onExit,
)
}