Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that only valid nodes are added to tray item menus #370

Merged
merged 1 commit into from
Apr 29, 2023

Conversation

serebit
Copy link
Member

@serebit serebit commented Apr 29, 2023

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

  • Squashed commits with git rebase -i (if needed)
  • Built budgie-desktop and verified that the patch worked (if needed)

@serebit serebit added the bug Something isn't working label Apr 29, 2023
@serebit serebit added this to the 10.8 milestone Apr 29, 2023
@serebit serebit requested a review from JoshStrobl April 29, 2023 00:35
Copy link
Member

@JoshStrobl JoshStrobl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Unfortunately haven't been able to reproduce it with the same autostarting apps that triggered it the first time, so I get the feeling a race condition of some sort is affecting it, but the PR looks good so gonna land it :) Thanks! 💎

@JoshStrobl JoshStrobl merged commit de1379f into main Apr 29, 2023
@JoshStrobl JoshStrobl deleted the prevent-tray-applet-segfault branch April 29, 2023 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants