unite-shell icon indicating copy to clipboard operation
unite-shell copied to clipboard

System Tray icons doesn't load in Wayland

Open friday opened this issue 4 months ago • 2 comments

Describe the bug

System Tray icons doesn't load in Wayland with Unite, furthermore getting this error when it fails:

gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed

It works with X11, and also if the app is running in Xwayland, but not with apps running inn pure Wayland.

This happens for example with Ulauncher (for which I'm the maintainer), but also other apps. When searching for the issue I found for example https://github.com/emirror-de/libayatana-appindicator-rs/issues/2#issuecomment-1219227056 I tried disabling tray icons in Unite and installed that extension instead, and it worked.

To Reproduce Steps to reproduce the behavior:

  1. Install Ulauncher https://ulauncher.io/#Download (it should happen on both v5 and v6, but I would recommend v6 for reproducing the issue)
  2. Make sure you have either gir1.2-ayatanaappindicator3-0.1 installed (or the corresponding names for other package managers)
  3. Tray icons are enabled by default, but if you already had Ulauncher installed and disabled them, change it back.
  4. Run ulauncher in a terminal to get the log output.
  5. The tray icon won't show, and you get a the error instead (ulauncher:549324): Gtk-CRITICAL **: 14:20:28.342: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed

Expected behavior No error and the tray icon should show.

Environment (please complete the following information):

  • OS: Arch
  • GNOME Shell version 48
  • Unite version 82

Logs Provide system logs related to unite extension using journalctl -g unite.

I'm not getting any errors in the unite log. For the apps I am getting GTK_IS_WIDGET (widget)' failed as mentioned-

Additional context The "Status Icons" extension that comes with Gnome Shell Extensions has the same issue, but https://github.com/ubuntu/gnome-shell-extension-appindicator works in Wayland.

I understand that this is probably not really a bug in Unite, but a bug in Gnome/Gtk that the Shell extension can work around somehow to avoid (like the ubuntu extension does).

friday avatar Jul 31 '25 12:07 friday

Hey @friday! Apologies for the super late response. There are two types of tray icon extensions: those that utilize libappindicator and those that use the GNOME Shell tray manager.

Unite employs the tray manager, and its implementation is quite straightforward as you can see here and here. The extension creates a new TrayManager instance, listens for add-icon and remove-icon events, adds icons to the panel, and forwards click events accordingly. However, it doesn’t have control over the tray icons or their creation process.

I think it would be better to report this to GNOME Shell and AppIndicator/KStatusNotifierItem issue trackers, as they may be able to provide better assistance.

From my testing, the Ulauncher tray icon works without issues if I start it from the GNOME Shell menu. However, running it from the terminal results in the same issue you described (GTK_IS_WIDGET (widget) failed).

jonian avatar Nov 16 '25 10:11 jonian

Thanks for the response and the technical details.

Feel free to close this. I won't be bringing this up with Gnome Shell etc at this point. I feel like I need to read more to understand the problem and we have other priorities right now.

Been using Unite for many years. Thanks for your work 🙏

friday avatar Nov 16 '25 19:11 friday