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

Systray apps on macOS can only be terminated via the systray menu quit button #3395

Closed
2 tasks done
d1ss0nanz opened this issue Nov 12, 2022 · 2 comments
Closed
2 tasks done
Labels
blocker Items that would block a forthcoming release bug Something isn't working

Comments

@d1ss0nanz
Copy link
Contributor

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

Systray apps on macOS can only be terminated by clicking on the systray Quit button.

This even interupts restart and shutdown of the OS (see screenshot).

How to reproduce

Try to quit the attached program by either clicking Quit in the dock or using the "Restart..." or "Shut Down..." function of macOS.
Neither will work.

Screenshots

Screenshot 2022-11-12 at 21 22 42

Example code

package main

import (
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/driver/desktop"
	"fyne.io/fyne/v2/widget"
)

func main() {
	a := app.New()
	w := a.NewWindow("SysTray")
	w.SetContent(widget.NewLabel("Fyne System Tray"))
	w.Hide()

	if desk, ok := a.(desktop.App); ok {
		m := fyne.NewMenu("MyApp",
			fyne.NewMenuItem("Show", func() {
				w.Show()
			}))
		desk.SetSystemTrayMenu(m)
	}

	w.SetCloseIntercept(func() {
		w.Hide()
	})
	a.Run()
}

Fyne version

2.2.4

Go compiler version

1.18.4

Operating system

macOS

Operating system version

13.0.1

Additional Information

Tried with different (older) macOS versions. Same result.

@d1ss0nanz d1ss0nanz added the unverified A bug that has been reported but not verified label Nov 12, 2022
@andydotxyz andydotxyz added bug Something isn't working blocker Items that would block a forthcoming release and removed unverified A bug that has been reported but not verified labels Nov 13, 2022
@andydotxyz
Copy link
Member

I have finally tracked this down...

GLFW terminates an app by closing all the windows.
And we have told an app with systray to not close when the windows are shut.

Not yet sure how to resolve this, probably some more complex fix to GLFW required...

@andydotxyz
Copy link
Member

Fixed on develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants