I was able to locate the problem. The problem is in ubuntu's "appmenu-qt5" and is a bug that cause our call to QSystemTrayIcon::isSystemTrayAvailable() to remove the icon.
That's because appmenu-qt5 seems to assume there is only one QPlatformSystemTrayIcon while there can be one per QSystemTrayIcon. in particular, QSystemTrayIcon::isSystemTrayAvailable creates a temporary one, and when it gets distroyed, it unregister the dbus object for the existing systray.
Copying Olivier's comment from upstream bug:
I was able to locate the problem. The problem is in ubuntu's "appmenu-qt5" and is a bug that cause our call to QSystemTrayIcon ::isSystemTrayA vailable( ) to remove the icon.
That's because appmenu-qt5 seems to assume there is only one QPlatformSystem TrayIcon while there can be one per QSystemTrayIcon. in particular, QSystemTrayIcon ::isSystemTrayA vailable creates a temporary one, and when it gets distroyed, it unregister the dbus object for the existing systray.
Adding the appmenu-qt5 task accordingly.