-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 system tray support #283
Comments
Yes it will, at some point. Probably not in 1.1 or 1.2 but I would like to see it added soon after. |
I use systray to achieve this function, first transition |
+1 |
Currently we don't have sub-menu support either. Systray will come :) |
When i use systray and fyne. It works perfectly fine on windows OS, but fails on Mac OS. Is there a workaround to this problem? it seems its caused by runtime.LockOSThread() used by fyne and systray in the main. Stack trace: 2020-05-12 21:02:57.559 main[12053:8552769] *** Assertion failure in +[NSUndoManager _endTopLevelGroupings], /BuildRoot/Library/Caches/com.apple.xbs/Sources/Foundation/Foundation-1455.12/Foundation/Misc.subproj/NSUndoManager.m:361 |
macOS requires that code manipulating graphical elements run on the main thread. Do these things must run within the main() goroutine. Future versions of Fyne will be enforcing this to ensure cross platform consistency. |
Submenu support is now in so it seeme likely that we could include systray in 2.0 late this year |
any progress ? |
No, sorry. 2.0 is due this month but we are really up against it and late last year really did not exactly go according to plan (as for many people). |
Does anyone have a workaround/suggestion for being able to use systray right now? My use case is an always persistent tray that can launch one or more fyne windows, but I haven't had much luck yet getting them working together. |
You will need a system tray API that does not require blocking the main thread @grantmoore3d. |
Sadly it looks like we will have to implement this from scratch as the Linux implementations all seem to use GTK/Qt. |
https://github.com/getlantern/systray The systray repo have already done these work, why don't we merge from it. |
I think we'd more like to have a decent API set rather than using it directly merging it from the others. Maybe, we could have something like fyne.io/x/tray as a fork of that package, that collaborate with the existing fyne codebase (which resolves the mainthread issue), No compatibility guarantee though, purely experimental. |
We cannot use tools like systray as they bring in external dependencies (like GTK+ on Linux) |
For experimental purposes, we may have it work with external dependencies first (then rewrite it afterward)? |
I don't think that depending on another widget toolkit is a good idea, even in the short term. |
Not really sure (because I haven't program any tray application yet) the main repository will depend on an external. But ideally, it should be like a standalone package where people may:
When the design converges to a fixed point, the only change might be: -import "fyne.io/x/tray"
+import "fyne.io/fyne/v2/tray" |
Proposal for the API (yes it is super simple, but fulfils what was agreed to add at this stage): type desktop.App interface {
SetSystemTrayMenu(*fyne.Menu)
} Usage: menu := fyne.NewMenu("Tray menu title", items...)
a := app.New()
if desk, ok := a.(desktop.App); ok {
desk.SetSystemTrayMenu(menu)
} Potentially we also need |
There are a few possibilities for implementing this in Android;
|
Hi, Is there maybe already a prototype I could use for hacking? I looked at systray already. But I took the restriction to have no other dependencies than Golang, and therefore I want to use fyne and fyne only. |
You can track development on |
Thank you for the effort! I think it will come just in time for the continuation of my project. :) |
Thanks for this excellent integration. I tried to give it a go (I know it is still WIP) for a little project that I am building. With this piece of code:
However, when I hit the "Login" button, the log message gets printed only once. After that, the "Login" menu does not seem to be active, and repeated presses don't invoke the callback (and hence do not print the log message). Any idea what might be the issue? Thanks in advance. |
Thanks for the report @riyalol I will look into it as I develop the feature further. |
That issue is resolved on the latest commit of the PR @riyalol :) |
Damn, my current usecase is Linux only. Fingers crossed for easy solveable problems on Linux. * Impatiently waiting * ;) |
Anything you know about dbus menus may help progress the Linux stuff quicker - it is a spaghetti of services and interfaces without documentation :( |
I as well do only know the basics. 😒 I could just find the dbus spec: https://dbus.freedesktop.org/doc/dbus-specification.html With dbus menus specifically i couldn't find anything additional, tbh. So nothing new to add. :( :( :'( |
Landed in develop :) |
@andydotxyz Hi, thank you so much for developing these features. P.S.1: I found github.com/fyne-io/systray, P.S.2: Yeah, this is not a place to talk about Go language itself, |
The code above is a type query - Notifications work without anything special as they are on all platforms and are at |
Thanks! works like a charm. (Just for future reference, edited:) Anyways, now I can see the related definitions as well. P.S. Solution: use 'replace' directive in go.mod file so that Go can resolve to the correct version of the package. |
why not to realese |
This will be in the next release and it is releasing very soon. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Why is this KDE-dependent? Shouldn't you use the following? |
It isn't KDE specific - but all the panels we tested supported the kde notation but did not all support the FDO specification. |
sometimes I need the app to minimize, and stay in the system tray, will
fyne
support system tray?The text was updated successfully, but these errors were encountered: