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

fix: Load systray items that are registered without a path #1230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kage-Yami
Copy link

Description

In some environments (e.g. Budgie Desktop on Ultramarine Linux 40, or when using home-manager's status-notifier-watcher on Nix), StatusNotifierItems don't have their path as part of their registration, resulting in these items always failing to load in the systray widget.

This fixes those "misbehaving" registrations, via DBus introspection; the node tree from the top is crawled until any node implementing org.kde.StatusNotifierItem is found, and the path to that node is used as the resulting systray item path.

It also removes string slicing for the same code path that assumed :-prefixed addresses without paths must always be a total of 6 characters, when they can be shorter. (This unrelated issue was "hiding" the real issue in some circumstances.)

Additional Notes

Because DBus introspection (including via zbus) spits out XML, quick-xml was added as a dependency (and serde promoted from a transient dependency to an explicit dependency) to notifier_host.

The "crawl" mentioned earlier is implemented by way of a recursive function; given my (albeit naive) understanding of DBus, the trees will never be very deep, so I don't foresee this recursion being problematic.

Checklist

Please make sure you can check all the boxes that apply to this PR.

  • All widgets I've added are correctly documented.
  • I added my changes to CHANGELOG.md, if appropriate.
  • The documentation in the docs/content/main directory has been adjusted to reflect my changes.
    • (Errm, the docs/content directory doesn't seem to exist?)
  • I used cargo fmt to automatically format all code before committing

@Kage-Yami Kage-Yami mentioned this pull request Nov 18, 2024
3 tasks
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