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

Ability to Quit Systray Application with Keybind #3536

Open
2 tasks done
Beebeeoii opened this issue Jan 3, 2023 · 1 comment
Open
2 tasks done

Ability to Quit Systray Application with Keybind #3536

Beebeeoii opened this issue Jan 3, 2023 · 1 comment

Comments

@Beebeeoii
Copy link
Contributor

Checklist

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

Is your feature request related to a problem?

I am unsure if there is a way around this. What I am trying to achieve is to have cmd q quit the application which has a close interceptor set. I require the close interceptor as I would like to hide the main window and minimise it to systray when users click on the close button.

However, by convention on macOS, cmd q should close the application even if the close interceptor overrides and simply hides the window. Is there any way to work around this?

Thanks !

Is it possible to construct a solution with the existing API?

No response

Describe the solution you'd like to see.

To be able to listen to keybinds in the close interceptor so that when user executes cmd q, i can call app.Close()

@andydotxyz
Copy link
Member

Coming back to this because the way that system tray handles windows changed a little.
A quit call should still call the window callbacks in case there is unsaved work.

I guess you could listen to the key combination on your window canvases - or add a custom Quit menu item that calls your own function. I think either of these should work now - can you confirm @Beebeeoii ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants