Skip to content

xapp-status applet: harden against misbehaving clients and fix icon lifecycle issues - #13965

Open
zquestz wants to merge 1 commit into
linuxmint:masterfrom
zquestz:xapp-status-applet-hardening
Open

xapp-status applet: harden against misbehaving clients and fix icon lifecycle issues#13965
zquestz wants to merge 1 commit into
linuxmint:masterfrom
zquestz:xapp-status-applet-hardening

Conversation

@zquestz

@zquestz zquestz commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

The Electron 43.3.x tray regression (electron/electron#52674,
signalapp/Signal-Desktop#7995) surfaced several ways a
single misbehaving status icon client can degrade the whole XApp tray. The Electron
bug itself is fixed upstream in 43.4.1, but the weaknesses it exposed in the applet
are worth fixing regardless.

Three groups of changes, all in the xapp-status applet:

Null-guard proxy properties. Name, IconName, and Label belong to another process
and can be null. _sortFunc() called .includes() on icon_name and .replace() on
name, setLabel() read proxy.label.length after already establishing the label was
falsy, and shouldIgnoreStatusIcon() called .toLowerCase() on name. A TypeError in
any of these propagates out of a signal handler, leaving the panel with a half-sorted
tray or an icon that never finishes being added.

Discard stale async image loads. When an icon switched from a file path to a
themed name (or was cleared or destroyed) while a file load was still in flight, the
load's completion callback would overwrite the newer icon, or touch a destroyed
actor. The texture cache handle is now invalidated at each of those points and stale
callbacks are discarded. The logError on handle mismatch is removed since a mismatch
is now the expected result of deliberate invalidation rather than an anomaly.

Lifecycle fixes. XAppStatusIcon.destroy() never destroyed its actor, leaking
actors every time an app quit (RecorderIcon in the same file already does this
correctly). The ui-scale debounce timer was also left running when the applet was
removed from the panel, so a pending refreshIcons() could fire against destroyed
icons.

No behavior change for well-behaved clients.

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