diff --git a/pkg/systray/run.go b/pkg/systray/run.go index 8877d646f4dad154140700efc2c157e23acceee5..2a513d8c7b3c9220cabf3cf86f798a39f406a2fa 100644 --- a/pkg/systray/run.go +++ b/pkg/systray/run.go @@ -24,7 +24,7 @@ import ( ) func Run(conf *Config) { - bt := bmTray{conf: conf} + bt := bmTray{conf: conf, waitCh: make(chan bool)} go initialize(conf, &bt) bt.start() } diff --git a/pkg/systray/systray.go b/pkg/systray/systray.go index 11ed8c39f55788ce85432d0114e0807d33431bb1..d95d3dc7d7e4b58f272670584e4a8d721f69a10c 100644 --- a/pkg/systray/systray.go +++ b/pkg/systray/systray.go @@ -83,9 +83,13 @@ func (bt *bmTray) onReady() { systray.AddSeparator() bt.mQuit = systray.AddMenuItem(printer.Sprintf("Quit"), "") + bt.waitCh <- true } func (bt *bmTray) loop(bm bitmask.Bitmask, notify *notificator, as bitmask.Autostart) { + <-bt.waitCh + bt.waitCh = nil + bt.bm = bm bt.notify = notify bt.autostart = as