aboutsummaryrefslogtreecommitdiffstats
path: root/systray.go
diff options
context:
space:
mode:
Diffstat (limited to 'systray.go')
-rw-r--r--systray.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/systray.go b/systray.go
index 5ee6609..d4f86cc 100644
--- a/systray.go
+++ b/systray.go
@@ -52,20 +52,18 @@ func Run(onReady func(), onExit func()) {
runtime.LockOSThread()
if onReady == nil {
- onReady = func() {}
+ systrayReady = func() {}
} else {
// Run onReady on separate goroutine to avoid blocking event loop
- origOnReady := onReady
readyCh := make(chan interface{})
go func() {
<-readyCh
- origOnReady()
+ onReady()
}()
- onReady = func() {
+ systrayReady = func() {
close(readyCh)
}
}
- systrayReady = onReady
// unlike onReady, onExit runs in the event loop to make sure it has time to
// finish before the process terminates