Public bug reported:

libayatana-appindicator3-1 0.5.93-1build3 on noble (Linux Mint 22.3,
Cinnamon). The functions involved are the same in 0.5.94, so resolute
and later have it too.

With xapp-sn-watcher as the watcher, AppIndicator apps sometimes show up
twice after login, once through StatusNotifier and once as an XEmbed
tray icon. Here it is Diodon. The app is registered with the watcher
only once.

When org.kde.StatusNotifierWatcher has no owner, name_vanished_handler()
arms a 100 ms fallback timer. If the watcher takes the name before the
timer fires, RegisterStatusNotifierItem succeeds while priv->status_icon
is still NULL, and register_service_cb() does nothing about the pending
timer. It fires anyway and creates the GtkStatusIcon. Nothing removes it
afterwards.

To reproduce, start an indicator while no watcher owns the name, then
start a watcher within 100 ms. gdb timeline in a test indicator, with a
stand-in watcher started right after the indicator found no owner (times
from the indicator's first name check):

+3.8 ms    name_vanished_handler (start_fallback_timer at +4.1 ms)
+62.6 ms   watcher owns org.kde.StatusNotifierWatcher
+65.4 ms   register_service_cb (success)
+105.2 ms  fallback_timer_expire -> fallback -> gtk_status_icon_new
           (no unfallback, XEmbed window stays mapped)

I repeated the race with the watcher appearing 59 to 109 ms after the
indicator looked. 0.5.93 built from the release tag doubled the icon in
4 of 5 runs (the clean one had the watcher at 109 ms). 0.5.93 with only
the pending timer removed in register_service_cb() doubled in 0 of 5,
and upstream 0.6.1 also in 0 of 5. With the real xapp-sn-watcher on a
private bus, the watcher claimed the name only after the 100 ms timer,
and neither 0.5.93 nor 0.6.1 doubled. I reproduced the race inside the
window only with the stand-in watcher. At my login diodon started 70 ms
after the watcher.

Upstream 0.6.1 (October 2026) removes the pending timer in
register_service_cb(), in
https://github.com/AyatanaIndicators/libayatana-
appindicator/commit/02d827a58bdd4f6f103140a6ce2bae8618ae59d9. That
commit was written for a missing StatusNotifierHost and fixes this as a
side effect. 0.6.1 is not packaged in Ubuntu, and Debian has only 0.6.0
in experimental.

Could a fix for this reach noble and resolute? I can test a package from
-proposed or a PPA.

** Affects: libayatana-appindicator (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2174464

Title:
  XEmbed fallback icon stays next to the StatusNotifier icon when the
  watcher appears within 100 ms

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libayatana-appindicator/+bug/2174464/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to