AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
24.62k stars 2.13k forks source link

Freedesktop system tray spec support #13782

Open OmegaRogue opened 7 months ago

OmegaRogue commented 7 months ago

Currently on linux, avalonia only supports the KDE Appindicator Spec for tray icons. This isn't supported everywhere, and where it's not supported, Avalonia apps crash instantly. The freedesktop systemtray spec is usually supported at least as a fallback, avalonia is the only place ive noticed it not being supported. https://www.freedesktop.org/wiki/Specifications/systemtray-spec/

Originally posted by @OmegaRogue in https://github.com/AvaloniaUI/Avalonia/issues/2649#issuecomment-1833430654

maxkatz6 commented 7 months ago

Avalonia apps crash instantly

It shouldn't crash, where isn't supported. Please create a proper bug issue.

maxkatz6 commented 7 months ago

KDE tray implementation for Avalonia, if anybody is interested in helping: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.FreeDesktop/DBusTrayIconImpl.cs

OmegaRogue commented 7 months ago

Avalonia apps crash instantly

It shouldn't crash, where isn't supported. Please create a proper bug issue.

I'm on awesomewm, and the App that's crashing is Artemis 2 RGB

OmegaRogue commented 7 months ago

Avalonia apps crash instantly

It shouldn't crash, where isn't supported. Please create a proper bug issue.

Should i create a new issue?

timunie commented 7 months ago

@OmegaRogue yes, exactly. With detailed info how to reproduce. thx 🙏

thevortexcloud commented 7 months ago

I am guessing it was done this way because of Wayland. There does not seem to be a generic protocol for generic tray icons on Wayland that I can see (although I may be missing it). In which case it's up to every UI toolkit to implement what ever protocol extension every DE has. The GTK implementation of the system tray spec for example is X11 only and has been deprecated. . What they suggest to use to replace it does not at all sound like it has equivalent functionality. Not that should really matter as Avalonia does not have a native Wayland backend yet (although one is being worked on). I am not sure how XWayland would handle this either. But someone who knows better may be able to say more.

OmegaRogue commented 7 months ago

I am guessing it was done this way because of Wayland. There does not seem to be a generic protocol for generic tray icons on Wayland that I can see (although I may be missing it). In which case it's up to every UI toolkit to implement what ever protocol extension every DE has. The GTK implementation of the system tray spec for example is X11 only and has been deprecated. . What they suggest to use to replace it does not at all sound like it has equivalent functionality. Not that should really matter as Avalonia does not have a native Wayland backend yet (although one is being worked on). I am not sure how XWayland would handle this either. But someone who knows better may be able to say more.

yea, the main problem with gtk is that gtk is mainly maintained by gnome nowadays, and they don't really like or want tray icons

RushingAlien commented 3 months ago

yea, the main problem with gtk is that gtk is mainly maintained by gnome nowadays, and they don't really like or want tray icons

That is no longer true, GNOME is participating in the disucssion about a new status icon protocol to succeed kde's statusnotifier(appindicator) protocol. https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/54

To note there are currently two de-facto protocols:

Appindicator is well on its way out as most apps are using statusnotifier now