xapp-status applet: harden against misbehaving clients and fix icon lifecycle issues - #13965
Open
zquestz wants to merge 1 commit into
Open
xapp-status applet: harden against misbehaving clients and fix icon lifecycle issues#13965zquestz wants to merge 1 commit into
zquestz wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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()onname,
setLabel()readproxy.label.lengthafter already establishing the label wasfalsy, and
shouldIgnoreStatusIcon()called.toLowerCase()on name. A TypeError inany 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, leakingactors 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 destroyedicons.
No behavior change for well-behaved clients.