Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add notifier and universal link handler to run group before menu init #1894

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions cmd/launcher/desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,15 @@ func runDesktop(_ *multislogger.MultiSlogger, args []string) error {

// Set up notification sending and listening
notifier := notify.NewDesktopNotifier(slogger, *flIconPath)
runGroup.Add("desktopNotifier", notifier.Listen, notifier.Interrupt)

server, err := userserver.New(slogger, *flUserServerAuthToken, *flUserServerSocketPath, shutdownChan, showDesktopChan, notifier)
if err != nil {
return err
}

universalLinkHandler, urlInput := universallink.NewUniversalLinkHandler(slogger)
runGroup.Add("universalLinkHandler", universalLinkHandler.Execute, universalLinkHandler.Interrupt)
// Pass through channel so that systray can alert the link handler when it receives a universal link request
m := menu.New(slogger, *flhostname, *flmenupath, urlInput)
refreshMenu := func() {
Expand Down Expand Up @@ -184,11 +187,6 @@ func runDesktop(_ *multislogger.MultiSlogger, args []string) error {
go func() {
// wait to show desktop until we get the signal from root
<-showDesktopChan

// once desktop enabled, add notifier and universal link handler
runGroup.Add("universalLinkHandler", universalLinkHandler.Execute, universalLinkHandler.Interrupt)
runGroup.Add("desktopNotifier", notifier.Listen, notifier.Interrupt)

systray.Show()
}()

Expand Down
Loading