Fyne: will `fyne` add system tray support?

Created on 30 May 2019  路  7Comments  路  Source: fyne-io/fyne

sometimes I need the app to minimize, and stay in the system tray, will fyne support system tray?

future

Most helpful comment

Submenu support is now in so it seeme likely that we could include systray in 2.0 late this year

All 7 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
i need to create app with only system tray. But systray package cant create multi-level menu

Currently we don't have sub-menu support either.
We should add it soon, though I don't think it has a ticket so I will add one now.

Systray will come :)

I use systray to achieve this function, first transition

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
2020-05-12 21:02:57.560 main[12053:8552769]
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+[NSUndoManager(NSInternal) _endTopLevelGroupings] is only safe to invoke on the main thread.'
*
* First throw call stack:
(
0 CoreFoundation 0x00007fff363c8d7b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff5d664c76 objc_exception_throw + 48
2 CoreFoundation 0x00007fff363ceb12 +[NSException raise:format:arguments:] + 98
3 Foundation 0x00007fff384faa30 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 Foundation 0x00007fff38489624 +[NSUndoManager(NSPrivate) _endTopLevelGroupings] + 469
5 AppKit 0x00007fff338ce936 -[NSApplication run] + 997
6 main 0x0000000004494b30 nativeLoop + 160
7 main 0x0000000004493903 _cgo_cafa63f1ae52_Cfunc_nativeLoop + 35
8 main 0x0000000004064200 runtime.asmcgocall + 112
)

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

codenoid picture codenoid  路  4Comments

andydotxyz picture andydotxyz  路  9Comments

lusingander picture lusingander  路  3Comments

develar picture develar  路  6Comments

Geo25rey picture Geo25rey  路  7Comments