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

macOS - Tray icon & minimize-to-tray not working correctly #140

Open
bbsixzz opened this issue Apr 23, 2023 · 10 comments
Open

macOS - Tray icon & minimize-to-tray not working correctly #140

bbsixzz opened this issue Apr 23, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@bbsixzz
Copy link

bbsixzz commented Apr 23, 2023

Version 0.1.0

Once the window is closed/hidden it can only be brought back using the tray/menu icon menu with Show.

Clicking the icon in the Dock does nothing.

@dweymouth
Copy link
Owner

You can also bring it back by right-clicking on the dock and selecting the window in the context menu. You're right that the correct behavior is for clicking the dock icon to re-show the window but that is currently not possible with Fyne. Being a young toolkit and cross-platform (including web and mobile!) it has some rough edges that should hopefully keep getting better with time.

@dweymouth
Copy link
Owner

Opened an issue with Fyne: fyne-io/fyne#3845

@bbsixzz
Copy link
Author

bbsixzz commented Apr 23, 2023

Alright,

ideally + W should also close the window but it doesn't work.

Would it be possible to have the tray/menu icon just show/hide the window?

Just a suggestion, right now the menu doesn't bring much functionality so it might be worth it?

Would you rather play/pause or play previous/next from the menu or have the main window brought up?

@dweymouth
Copy link
Owner

dweymouth commented Apr 23, 2023

Cmd+W to close the window I can add. Thanks for the suggestion, I'll get it in the next release as it should be a really quick addition. (Question: should this shortcut only be enabled if close to system tray is enabled? Probably yes, as otherwise it would have to quit the app which is confusing and unexpected.)

As far as the system tray, I believe Fyne only supports showing a menu with the system tray icon and doesn't currently support assigning any other actions to it.

@bbsixzz
Copy link
Author

bbsixzz commented Apr 23, 2023

Question: should this shortcut only be enabled if close to system tray is enabled?

Well, a lot of apps close the window (e.g. Finder, Mail.app) without actually quitting, but this is inconsistent.

Many apps that need to stay up seem to follow this convention but I don't know what the Apple HIG says about it.

@dweymouth
Copy link
Owner

Hmm, weirdly, clicking on the tray icon twice does seem to bring the window back, if another app now has focus (Mac OS Big Sur) but this is probably a Fyne bug.

@bbsixzz
Copy link
Author

bbsixzz commented Apr 23, 2023

Hehe, well I can't reproduce it on Ventura 13.3.1 (22E261).

@bbsixzz
Copy link
Author

bbsixzz commented Apr 23, 2023

On a tangent,

I think the most macOS thing to do is to just close to Dock with + W without the menu bar/tray.

Whenever it becomes possible.

@dweymouth
Copy link
Owner

Cmd+W to close window (if close to tray enabled) added in b017995

@bbsixzz
Copy link
Author

bbsixzz commented Apr 24, 2023

I just had an idea, I remapped + W like this in settings and solved the problem natively.

Screenshot 2023-04-24 at 06 27 01

@dweymouth dweymouth added the enhancement New feature or request label Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants