-
Notifications
You must be signed in to change notification settings - Fork 657
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
Proposal: System tray icon for WinUI 3 Desktop (Win32 and .NET Core) #2020
Comments
Windows 10X doesn't support this. I don't think it should be brought back. |
@jesbis can you please route this request ? |
@shaheedmalik I would argue that just because Windows 10X doesn't support it, it doesn't mean Windows 10 shouldn't. Keep in mind there are over 950 million users of Windows 10. |
@marb2000 FYI |
I think system tray icons should be removed from Windows completely. We should move to having all applications on the task bar for consistency. It is nonsensical to see apps in both places. Why is one app on the task bar and another in the sys-tray, and another in both? There is no logic to it. If you want some icons on the right and some on the left - we don't need a system tray, what we need is more task bar customization. |
Maybe but I am not sure. For me system tray icons don't have the same utility as the taskbar icons:
|
Is there another simple, elegant and intuitive way for background process to interact with users, without needing to be a windows based app. If so, then may be system tray is redundant, if that is the only way, then it needs to be retained. I think there are plenty of use cases for it. |
An app can be pinned to the Windows 10 Start menu and use the Badge API and Tiles API to inform the user and notify them about app events. Right-clicking on the app's entry in the Start menu opens a context menu which can be populated using the Jumplist API. In light of 10X removing the notification area I am currently in the process of replacing my app's notification area entry with a Start menu entry using the above mentioned APIs. Users of my apps have been supportive of this change. |
10X is not removing a notification area, but only displaying the notifications, without a sidebar. The quick actions are going in their own separate UI area. Tray Icons could theoretically be placed in either of those spaces, except that for 10X, they idea of background apps being installed is possibly something they wish to avoid. There are other ways to achieve the same things, but until 10X gets fully detailed, and in the hands of testers - feedback on this will have to wait. I see no reason why WinUI Desktop apps on Windows 10 will not be able to use Tray Icons. If there is a control or UI surface that could be afforded to the app dev, to enable a consistent Tray UI and UX - I would be in favour of that. Too much inconsistency with flyout, menu styles at present. |
@mdtauk With "10X removing the notification area" I mean the area I believe folks here are describing as the "system tray": https://docs.microsoft.com/en-us/windows/win32/uxguide/winenv-notification |
System Tray is how I think of it - so I just wanted to distinguish that and the Windows 10 area where notifications are kept. |
Action Center is the name of the UI region where notifications are kept in Windows 10. MS seemingly contributes to the confusion by using both "system tray" and "notification area" term for the same UI region, yet the documentation states: As UWP apps do not have direct support for the "system tray" and 10X scraps it entirely (based on the latest info we have) it seems this is not a direction where MS wants to keep going. Consequently, I would rather be interested in why pinning an app to the Start menu and using the above mentioned APIs is not an option compared to putting an app icon in the system tray/notification area. And if it's not an option we should tell MS why that's the case so they can improve how users can interact with background apps using the UWP Shell interaction concept (Tiles, Badges, Notifications). WinUI 3 Desktop apps asking for notification area (system tray) support will still need a way to notify/inform their users on 10X, which is apparently the future of Windows. I'm not sure if users, who are now asking for system tray support, will not ask MS to add the "system tray" back to 10X as well. As their request likely wouldn't be granted they will have more work to do to make their Windows 10 WinUI app ready for 10X. As such, I feel we should use this proposal to unify the ideas and concepts of the notification area (system tray) and the new app feedback/interaction areas MS introduced with Windows 8/10. Find out where the current UI is lacking and try to improve it. I don't think much is missing from the current UWP Shell APIs. |
Mostly its for apps running without any UI or window, which then opens a window or displays UI when interacted with. As there is no window open or minimised, there is nothing to switch to on the taskbar, and no window to display in the timeline or task switcher views. |
Developers tend to put their app in the system tray because they have a sense that their app is ultra important. As a user, 99% of the time the app isn't as important as the developer thinks. Right now I have Defender, Bluetooth Devices, Nvidia Settings, Dolby Audio, Ear Trumpet, and OneDrive running in my system tray. Out of all of these, probably only Ear Trumpet needs to be down there. The rest are not that important. Even Defender could tell me what I need to know from the Action Center. |
Not important to you, however, they are important to me and many Windows users. Without system tray, they will move to taskbar which is worse. System tray is primarily a place for services and background apps to show they are running while allowing some from of control over it's state without polluting the main taskbar. They are intended for at-a-glance status with quick interactions. Apps in taskbar are intended to show apps you would interact with in the foreground for longer periods of time. This allows task switching between multiple foreground apps. Messaging apps fit in the middle. For a long-time they minimized to system tray because they are mostly background and not interacted with until a message pops in or you open it to message someone. If it is a primary, daily messaging app for work, I pin it to my taskbar for primary work. However, some apps are rarely used anymore and clutter so I keep them minimized in system tray until every once and while I need it. What I don't want is to think my messaging app is running and come to find out it is not, and I have 20 missed messages. System tray has it's real use, but I get it, it's challenging. The more apps you install, the more clutter and potential abuse of a feature. For example, apps launching on startup or login. Useful, but abused heavily. However, removing it just because it's clutter and abused is the wrong approach. User control and now AI for managing what shows up and where are the best ways to handle the problem. With Windows 8 and 10X that Microsoft is rethinking many paradigms to see how can they advance the OS. The problem is, Windows 95, XP, 7 got so many paradigms right, that you can't really remove them without breaking lots of user stories. It's hard to innovate on a 2D space when you already solved the problem better than other methods! The other challenge is real estate on smaller screens. With Windows 10X, they don't have background apps working so not having a system tray built yet makes sense. I think once they bring back background apps and services, they will find a way to bring the tray back, but maybe in a different form than what we are used to so they can solve the real estate problem. |
Using the Start menu as described above can work just fine for those types of apps. I have such an app myself which can start completely minimized (no taskbar app icon, no app window) yet I can use the Badge API and notifications to inform the user when something happened and they can decide to bring it to the foreground using the Start menu (just as they would with the notification area app icon). A potential Shell improvement: After discussing with others, it was suggested that, for example, the app's context menu shown in the Start menu could be improved to allow multi-level hierarchy or UI elements such as checkboxes and radio buttons as those can be easily added to Win32 notification area context menus today. In general, it would be useful to get a wide variety of "system tray" app context menus in use today, see how they designed and where exactly the UWP Shell APIs are lacking today. PS: Here is a blog post by Raymond Chen clarifying that "system tray" is not the correct terminology and "notification area" should be used instead: https://devblogs.microsoft.com/oldnewthing/20030910-00/?p=42583 |
I strongly disagree. I don't know your app so I can't speak to your user story but a whole class of apps do not work well buried inside hidden surfaces such as Start Menu or Action Center. These apps include: signal strength indicators, battery level, CPU/GPU Temperatures, Sync statuses, Message Indicators, etc. How can we classify all these apps to better understand them? I think we understand notification apps quite well and Action Center helped improve their use cases. But the other apps fit better as "Monitoring". Monitoring is not the same as Alerts and Notifications which is a common misconception. Monitoring is about seeing the status at all times. The ability to quickly look over every once and while with no additional action, and move on. Battery level is a good one for this. I can glance over at a battery indicator and see how my battery is doing. I want notifications for critical events like low battery but I don't want notifications for 70%, 50%, or 30%. I just want to look over and check it. Guess what,, time is the same thing! I look over to see time without further action, hence why it is in the Taskbar Notification Area! These may be considered system OS but there are many apps that provide similar functionality that the OS does not have. Now, does this mean every app should be in the notification area like today? Is it abused because there was no other good place for it before? Sure. I think a lot of improvements can and are being made here. Quick Actions/Control Center has the potential to replace many types of apps in this regard. But, that can quickly get bloated too, making it hard to find the "quick actions". "Changing the paradigm doesn't solve the problem, it just moves the problem to a different space" Moving apps to pinned taskbar just bloats the taskbar This is why Live Tiles has not gained traction outside of Windows Phone, they are buried in a hidden surface so they lose their usefulness and full potential. On Windows Phone, the desktop and start launcher are merged to same thing making it useful there. On Windows 8+, desktop and taskbar are your main visibility points. Hence why Live Tiles on Desktop is a popular request since it would likely be nearly always visible on larger screens. Let's be mindful that there is a purpose for all things. We can certainly look at moving things around but we need to understand the full classification of apps and if they would truly benefit in moving or do they lose their usefulness and purpose as a result. Windows 10X is still far from complete and until we know more, we shouldn't assume anything. This proposal is for fixing a gap in UWP / WinUI that needs to be resolved to fit in the breadth of how Windows is used. This is not going away anytime soon. |
I'd like the system tray experience to be revamped if possible. Something similar to macOS' menu bar apps. |
This would be a problem with the notification system. As Windows evolved, one doesn't need a system tray icon running just to notify you of potential messages. One can receive messages without cluttering up the system tray. |
For me, the use case for the tray icons is simple: I want to see the apps that run in the background there and for the icon in the tray to indicate either a continuous status (e.g. a CPU load/temperature indicator) or a discrete indicator that something's happened (say a messaging app icon saying that I got a new message). The actual message notifications go to the action center. If the app is not open and minimized to the taskbar or to the tray, I don't want it to be running at all. I'd like to be able to reliably tell if the app is running in the background or turned off. Basically, all the messengers used to work this way (by being a win32 app or by utilizing a win32 bridge companion app). |
Please don't. If apps want to use System tray, let them use the Win32 APIs available for that. No need for a WinRT API for a legacy feature |
well he is wrong you can clearly see at: https://c.s-microsoft.com/de-at/CMSImages/1920_Panel03_Video_Introducing_new.jpg?version=b1067fd1-f287-adae-d0c8-fed7f26313fa that there is a tray icon bar with network volumen and battery. they just open the control center, but they still use a tray icon and you can add your button by using the win32 tray icon api. heck even the "preview" teams app, outlook and onedrive will forever use the tray icon, so whats the point in not giving us a modern api for it. |
What they mean is that now network, microphone, battery, volume are not classical tray icons anymore in Windows 11 - those are directly builtin to the taskbar now (for example, you can't move them in the overflow menu). @schmitch There hasn't been anything announced about an API to WinUI 3 or the app SDK for tray icons, only consumer feature requests. But nothing stops the original Win32 API from working in WinUI 3. @SeidChr |
would it be required to start an external process to run outside the sandbox like in UWP? |
No because WinUI 3 desktop is not sandboxed. |
Even if WinUI 3 is not sandboxed, I think this should be brokered.
|
Tray icons are already implemented by doing IPC with the explorer.exe process. There is no point in brokering it. |
Could you Link some resources for this? |
For the source to my claim, here: microsoft/WindowsAppSDK#219 (comment)
If you want to actually implement one, start here: https://docs.microsoft.com/en-us/windows/win32/shell/notification-area |
@shaheedmalik it depends on what type of app and for which users the app is being created. You or I cannot decide what % of the time any app is important or not. I personally have clients who require tray icon and many module interaction based on that. (even if you look here, you will find many of the LIKERS do not agree with you.) Conclusively, one way or other, we need functionality of tray/notification icon. |
Conclusively, we also need functionality to configure whether an app resides in the taskbar corner. |
That's... out of scope for this project? |
Sure I can. I am the user. The user decides. |
Great, I am the user too. I find it super duper important. so add it! |
I want to note for the future that all this is already implemented in my H.NotifyIcon library. It also has an example of a Windowless application, as well as an example of a regular WinUI application with the ability to collapse. It also supports the ability to create a native context menu for TrayIcon with animation (still in preview mode) and some other features. The API is accessible from xaml and mostly inherited from hardcodet/wpf-notifyicon for easy transition to WinUI from WPF |
@HavenDV Looking right into it |
What does Microsoft have against the system tray? WinForms is the only one to have an official control for it, meanwhile for WPF, UWP, WinUI, and MAUI they don't bother adding official support for it? Meanwhile Teams, Skype, PowerToys, and a bunch of other Microsoft software has icons in the system tray. |
Probably because a class is not needed as it is very simple to add (just Shell_NotifyIcon + the window procedure for the Callback) |
When you receive uCallbackMessage, you can display anything (usually a Context Menu) |
hey.. but how does WinFirm UI look so elegant? can you please share how I can implement such style? the UI looks like UWP/WinUI.. |
As it is a .NET Framework app, you can see some parts of code with tools like ILSpy |
Still interested in this, commenting to avoid mass closing. |
Commenting to prevent closure. There is still a need for this. I am currently writing a Windows app and decided to use WPF as the UI framework. Why? Because as an 18-year old UI framework, it's still the most recent one provided by MS for C# which supports putting an icon in the notification area. The reasons originally stated in this thread for removal of the notification area are no longer relevant. Windows 10X was a dud. Windows 11 is here and still implements the notification area. So why doesn't Microsoft support using it for new apps? Generally speaking, on every computer used by a human with a GUI there are two types of processes - system processes and user processes. Most user processes run in the foreground, but for those that run in the background the user needs to be able to see at a quick glance the answer to 2 questions: (1) Is the background user process running? The notification area in Windows currently answers these 2 questions for background user processes such as cloud storage, 3rd-party anti-malware, and VPNs. If there is another UI paradigm that should be used to provide this status, it would be helpful for Microsoft to take the lead on its usage with apps like OneDrive. Nearly every desktop operating system has this functionality whether it's Windows, macOS, or Linux. Linux has a few exceptions depending on the window manager but the most common ones such as Gnome, KDE, Xfce, etc. all implement it. Newer popular UI frameworks such as Electron JS include APIs for creating notification icons. Event brand-new UI frameworks such as Tauri for Rust implement it as well. |
@80columns For now you can just use the Win32 API in WinUI. |
Shall we also create application windows with Win32 @80columns also worth noting that Avalonia has this actually properly built in too and with XAML too https://docs.avaloniaui.net/docs/reference/controls/detailed-reference/tray-icon |
I find it weird many WinForms or WPF applications typically seem to end up calling Win32 APIs somewhere, but when it comes to WinUI, the attitude seems to entirely reject doing that. Shell_NotifyIcon is rather simple to use too. |
Thank you @lloydjatkinson ! Avalonia looks perfect for WPF with native notification icon support.
Indeed, my current project uses a Win32 API to set the system wallpaper. But this has always been the standard interface for performing this action in Windows. MS didn't develop a newer interface to do this and then drop support for it. What doesn't make sense is dropping support for something which has been included in Windows UI frameworks for years, especially when Microsoft uses that functionality for new apps such as MS Teams and continues to use it for core apps such as Outlook and OneDrive. The reasoning behind moving away from the notification area seems clear - Microsoft wants Windows to behave more like a mobile OS, hence the recent change to move the Start button to the center of the screen in Windows 11 and to simplify the icons shown in the Start menu. But Windows is not a mobile OS and recent attempts to move it to more mobile hardware have not succeeded. I personally use a Surface Pro not because I want a mobile Windows device, but because I want a tablet which gives the user more control over the OS + software. Even Apple, who produces both desktop and mobile operating systems, understands that they are different experiences and doesn't try to merge them into one. I hope that Microsoft realizes there are many people out there who love Windows for what it is. |
I mean, WPF doesn't have built-in tray icon functionality either. |
Proposal: system tray icon for WinUI 3 Desktop (Win32 and .NET Core)
Summary
Add the ability to create NotifyIcon in system tray area. for WinUI 3 Desktop
Rationale
Scope
The text was updated successfully, but these errors were encountered: