Wire KeepRunningInTray to runtime so tray, close, and autostart follow the saved setting.

Autostart entries pass --start-in-tray only when the tray is enabled; Settings warns that the notification icon needs a restart (Fyne limitation).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-05 22:44:02 +03:00
parent 5170cc5f99
commit 5b0e6fe51b
22 changed files with 356 additions and 97 deletions
+6 -6
View File
@@ -9,22 +9,22 @@ type otherManager struct{}
// New returns the stub autostart Manager for unsupported platforms.
func New() Manager { return otherManager{} }
func (otherManager) Set(enabled bool, executablePath, iconPath string) error {
return SetAutostart(enabled, executablePath, iconPath)
func (otherManager) Set(enabled, startInTray bool, executablePath, iconPath string) error {
return SetAutostart(enabled, startInTray, executablePath, iconPath)
}
func (otherManager) Status(expectedEnabled bool, executablePath string) (bool, string) {
return AutostartStatus(expectedEnabled, executablePath)
func (otherManager) Status(expectedEnabled, startInTray bool, executablePath string) (bool, string) {
return AutostartStatus(expectedEnabled, startInTray, executablePath)
}
func SetAutostart(enabled bool, executablePath string, iconPath string) error {
func SetAutostart(enabled bool, startInTray bool, executablePath string, iconPath string) error {
if !enabled {
return nil
}
return fmt.Errorf("autostart is not implemented for this platform")
}
func AutostartStatus(expectedEnabled bool, executablePath string) (bool, string) {
func AutostartStatus(expectedEnabled bool, startInTray bool, executablePath string) (bool, string) {
if !expectedEnabled {
return true, "Autostart is off"
}