-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[v2] MacOS New feature of tray menu. #1010
Comments
I think the option you are searching for might be 'HideWindowOnClose' https://wails.io/docs/reference/options#hidewindowonclose Have you tried this option? |
I think they also want a tray menu. V2.1! |
Yes, I have tried. but I found a issue. When closed and the program is running in the background, we have no way to show the main interface by clicking on the icon in the dock, only through other dialog. |
Do u have any plan? I think others need this feature as well, thank you very much for your reply. |
It's true, |
Is it possible to contribute to this in any way? I was looking into making https://github.com/getlantern/systray work with Wails but, at least on MacOS, they both seem to import dependencies from the OS and thus make the
Even if there were a simple way to get past this, I think they both want to lock on to the main thread and thus other issues may arise. So I've been thinking of adding the needed components directly into Wails and then figuring out a way to lock the main thread while still allowing both the systray and the main window to be able to use it (although it sounds like it might not be as easy as I imagine it to be) |
Running systray and Wails together is basically impossible. Tray support is coming right after be release. If you want to contribute you can look at how this works on Linux. |
So I do the impossible. :-D Actually currently using a tray menu library together with Wails. Even run Wails only ad-hoc and close it (not hide). I'm sure it's all just a hack. But it works so far quite good. |
You're running 2 different processes for sure 😉 |
I'm still learning about how Wails work. For my simple app I made a main package only for binding (I don't use any bindings, btw) and a second with my main app. This app runs mostly in background sitting in the tray additionally. Through the tray menu I can open a Wails window, which only starts wails.Run() in a goroutine. The window (it's frameless) is closed via the runtime API. I also had another setup, where I only used show and hide of the Wails window. But since the process is mostly only in the background, you can save the ressources of the WebView. To make that possible, I had to reset the flags before running wails. Or you will get errors of already defined flags. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue is a mixture of requests. Closing in favour of #1521 |
Heya @sebastian0x62 -- I need this feature and don't mind being a bit hacky (even if running two processes) -- how exactly are you getting |
Hey @dvx, Still looking for a solution? I switched from web-based for Desktop development to Flutter. So I'm no longer actively looking into Wails and similar. I still have a tiny demo project for this systray thing. |
@dvx, tried to send you the demo via mail. GMail didn't like the attachment. You can find the project for download for two weeks: https://drive.proton.me/urls/WAH0Z5PZCR#NnZZDxHndOGS |
Thanks @sebastian0x62 -- got it! 🙏 |
Thanks @sebastian0x62 -- got it! 🙏 |
Turns out you can run |
@leaanthony I couldn't get the wails app to build (even with Thanks for your work! 🙏 |
You're right, the way the Mac system tray works is a bit different than Windows, which will allow you to run it in a goroutine. |
Any update of this requests? |
I'm trying the alpha version of V3, so far systray is working fine. |
@mostend - just be aware it's still in development and there's no API guarantees at this stage. That being said, there's a really awesome feature that's almost done and I think after that it will probably be stable 👍 |
Hello ! I am also interested by making a systray on my mac OS app, can you resend me the link please ? |
@leaanthony Wails is awesome! Any updates on v3 ETA? I really need systray and trying to avoid hacks, if possible. |
+1 |
Feel free to try out the alpha and see if it works for you: https://v3alpha.wails.io |
Thanks @leaanthony, will check it out |
Hi, I'm sorry to interrupt, but I've looked up a lot of information and I can't find.
I want to implement a feature where when the user clicks the close button, the program runs in the background and the small icon appears in the right menu bar.
The text was updated successfully, but these errors were encountered: