unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.93k stars 725 forks source link

Add systray support #4449

Open kotx opened 4 years ago

kotx commented 4 years ago

What would you like to be added:

Allow hiding apps to the system tray on Windows and Linux.

Why is this needed:

Hiding apps such as music players to the system tray in order to not clutter up alt+tab or taskbar.

For which Platform:

Anything else we need to know?

UWP doesn't have systray support, so this cannot be implemented for UWP at the moment.

nathanAjacobs commented 3 years ago

This would be a very useful feature. Some apps don't need a window to be shown at all times.

jeromelaban commented 3 years ago

Thanks for the report!

This is uncharted territory for Uno, really, because WinRT/UWP does not support being placed in the system tray. For WinUI/WinRT unpackaged, there's a proposal opened here and it looks controversial :)

One way to do this would be to have Uno provide its own implementation of a System Tray support for macOS, Windows and Linux somehow. If someone's interested in looking into implementing this, let's open an discussion in this repo to see what the API could look like.

pylorak commented 2 years ago

This is uncharted territory for Uno, really, because WinRT/UWP does not support being placed in the system tray. For WinUI/WinRT unpackaged, there's a proposal opened here and it looks controversial :)

The term "controversial" could itself be controversial :) What is evident from the linked issue is that although there are people who don't like the idea of a notification icon API in modern frameworks, there are way more (by multiple factors more and not just some marginal majority) people for it than against it.

HavenDV commented 2 years ago

I want to note that I already support some Uno platforms in my H.NotifyIcon library. The API is accessible from xaml and mostly inherited from hardcodet/wpf-notifyicon for easy transition to WinUI from WPF

jackerman88 commented 2 years ago

@HavenDV I'm currently evaluating using Uno for a project, but we need cross-platform (Win and Mac) systray support. What operating systems does your library support currently? Thanks!

HavenDV commented 2 years ago

Currently only Windows platforms are supported - WinUI and Uno.Skia.WPF As for other platforms, I'm unlikely to do this for free in the near future, since I do not have applications that need it. Avalonia seems to have support for at least iOS in their tray icon implementation.