Ensure that only valid nodes are added to tray item menus #370
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.
Description
This fixes segfaults caused by some apps that have tray icons. I believe that it happens due to bad implementations of the dbusmenu spec on the app side, which then cause the applet's internal record of the menu layout to be filled with invalid data. Solution is to completely ignore any items that don't have the correct type for the layout id (it should be int32), and also avoid showing menus without any items in them. This is reproducible with JetBrains Toolbox.
Needs review from @JoshStrobl, who I believe was seeing this happen with a different app.
Submitter Checklist
git rebase -i
(if needed)