mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-13 12:19:54 +00:00
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.
34 lines
708 B
Go
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()
|
|
}
|
|
}
|
|
}()
|
|
}
|