Skip to content

systray: fix icon loss on redisplay, timeout races, and teardown errors - #13966

Open
zquestz wants to merge 1 commit into
linuxmint:masterfrom
zquestz:systray-xembed-stability
Open

systray: fix icon loss on redisplay, timeout races, and teardown errors#13966
zquestz wants to merge 1 commit into
linuxmint:masterfrom
zquestz:systray-xembed-stability

Conversation

@zquestz

@zquestz zquestz commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Follow-up to the xapp-status applet hardening PR; this covers the XEmbed
side of the tray. Two files, four fixes, each with a concrete trigger.

Never-plugged icons were permanently lost on redisplay
(cinnamon-tray-manager.c). cinnamon_tray_manager_child_redisplay() called
on_plug_added() for every child, including sockets whose plug had not
arrived yet. For those, it created a CinnamonTrayIcon for an unplugged
window and emitted tray-icon-added for it, and worse, disconnected the
pending plug-added handler, so the real icon could never appear once the
app finished embedding. Redisplay runs on icon size changes, panel edit
mode, UI scale changes, role registration, and applet reload, so any
slow-embedding client was exposed. Skip children with no actor and leave
their plug-added handler in place.

TypeError on removal of hidden-role icons (systray applet). Icons whose
role is claimed by an applet (nm-applet with the network applet loaded, for
example) never get a button, so icon.get_parent() is null in
_onTrayIconRemoved() and the handler threw on every such removal.

Races in the 1-second delayed-show timeout (systray applet). The
timeout in _onTrayIconAdded() was untracked. If the icon was removed or a
redisplay ran within that second, the surviving callback could call
button.destroy() on an already-destroyed button, or animate an orphaned
icon. The source id is now stored on the button and cancelled from both
_clearIcons() and _onTrayIconRemoved().

Teardown cleanups. cinnamon_tray_manager_redisplay() and
_set_orientation() now tolerate the released-resources state after
x11-display-closing instead of hitting g_return_if_fail criticals, and the
applet cancels its pending ui-scale debounce timer when removed from the
panel.

No behavior change for icons that embed promptly and clients that exit
cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant