System Tray Icons in GTK4?

Hello everyone,
I am struggling to find documentation for adding system tray icons (sometimes called Taskbar icons) to GTK4 applications.

I was curious if anyone here may be able to point me into the correct direction.
Thank you so much for all of your time and energy! It is immensely appreciated.

I don’t think it’s supported, see What to use instead of StatusIcon in gtk4 to display the icon in the system tray?

There is no “system tray” in GNOME 40+, and app Indicators are an obsolete API anyway. Currently it is recommended to use the Background Portal in combination with Notifications.

Does the Background Portal / Notifications support showing just an icon that an app could update with, for example, unread message counts? If so, would it show up next to the clock, or the wifi icon area?

GNOME doesn’t do it by default, it is up to the desktop and user configuration whether to show notification counts. For example here is another extension that will do it. Notification Counter - GNOME Shell Extensions

AFAIK this is exactly how App Indicators worked as well, there was no requirement for it to show notification counts.

Edit: That only relates to notifications though, by default the icons will show in the quick settings menu and you can use xdp_portal_set_background_status to display any status message such as a count of messages.

It was actually removed in 3.26.

No. You’re not going to be able to do what you want unless you tell your users to install third-party shell extensions.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.