Files
netbird/client/ui/signal_unix.go
Zoltán Papp 9aef31ff53 [client/ui] Replace fyne UI with Wails (rename ui-wails to ui)
Removes the legacy fyne-based client/ui implementation and renames the
Wails replacement (client/ui-wails) to take its place at client/ui. Go
imports, frontend bindings, CI workflows, goreleaser configs and the
windows .syso icon path are updated to follow the rename.
2026-05-11 11:20:22 +02:00

34 lines
708 B
Go

//go:build !windows && !android && !ios && !freebsd && !js
package main
import (
"context"
"os"
"os/signal"
"syscall"
log "github.com/sirupsen/logrus"
)
// listenForShowSignal opens the main window when the process receives SIGUSR1.
// External tools (the daemon, the installer, or another `netbird-ui` invocation)
// can poke this channel by signalling the running pid.
func listenForShowSignal(ctx context.Context, tray *Tray) {
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, syscall.SIGUSR1)
go func() {
for {
select {
case <-ctx.Done():
signal.Stop(sigCh)
return
case <-sigCh:
log.Debug("SIGUSR1 received, showing window")
tray.ShowWindow()
}
}
}()
}