Skip to content

Dart Native libayatana library enhanced to meet system_tray requirements#81

Open
arran4 wants to merge 4 commits intoantler119:mainfrom
arran4:pure-dart-linux-backend-11614067322607371086
Open

Dart Native libayatana library enhanced to meet system_tray requirements#81
arran4 wants to merge 4 commits intoantler119:mainfrom
arran4:pure-dart-linux-backend-11614067322607371086

Conversation

@arran4
Copy link
Copy Markdown

@arran4 arran4 commented Mar 8, 2026

Because libayatana is GPL'd it can't be used without changing this libraries license so this PR replaces: #80

I found an existing but out of maintenance library that does the system tray on linux in pure dart: https://pub.dev/packages/xdg_status_notifier_item By canonical no doubt. I brought it up to standard: https://pub.dev/packages/dart_xdg_status_notifier_item

Related issues:

This will ensure that building on linux is easier, and better yet distribution doesn't "decay" as fast due to the packaging changes and forks that libayatana has gone through in the past couple years.

Has not been rigorously tested.

If anyone would like to help with that. Or simply just use it try

dependencies:
  system_tray:
    git:
      url: https://github.com/arran4/fork_system_tray.git
      ref: arran4:pure-dart-linux-backend-11614067322607371086

…notifier_item

- Replaces the native C++ Linux backend with `dart_xdg_status_notifier_item`
- Removes all FFI and C code from the Linux side
- Refactors architecture to use `SystemTrayPlatform` interface
- Eliminates MethodChannel usage on Linux
- Expands supported feature matrix (tooltips, titles, various click events)
- Cleans up example application dependencies to allow pure Dart testing
- Refactors pure dart Linux backend out of `SystemTrayPlatform` interfaces directly into `SystemTray` frontend logic with conditional checks
- Minimizes extra file creation based on PR feedback
- Makes `AppWindow` a pure dart no-op on Linux without complex mocking
- Fixes `dart_xdg_status_notifier_item` API breaking changes (swapped to named args)
- Restores example application state while maintaining pure dart compatibility
- Adds support for the `onScroll` event in Linux via `StatusNotifierItemClient`
- Reverts changes removing `bitsdojo_window` from the example app as it is needed to test application window operations.
- Showcases the new Linux-specific `onScroll` event inside the example app.
- Explains the constraint of stubbing out `AppWindow` methods on Linux when moving to a pure Dart implementation devoid of C++ dependencies.
No code changes were made; this cycle was purely for addressing the final review questions regarding XDG StatusNotifierItem specification limitations on Linux.
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