Replace libayatana-appindicator with native D-Bus StatusNotifierItem implementation#43
Draft
Replace libayatana-appindicator with native D-Bus StatusNotifierItem implementation#43
Conversation
…ntation Co-authored-by: lijy91 <3889523+lijy91@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issues with libayatana-appindicator for Linux support
Replace libayatana-appindicator with native D-Bus StatusNotifierItem implementation
Mar 8, 2026
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.
libayatana-appindicator(GPL-3.0) caused three compounding problems: GPL license contamination risk for downstream users, binary ABI incompatibilities across distros, and build failures in network-restricted packaging environments. The underlying functionality is just the StatusNotifierItem D-Bus spec, which can be implemented directly.Approach
GDBus (GLib/GIO) is already a transitive dependency of
gtk+-3.0, so this adds zero new dependencies.Changes
src/platform/linux/tray_icon_linux.cpp— Full rewrite:/StatusNotifierItemimplementingorg.kde.StatusNotifierItemIconPixmap(GdkPixbuf → ARGB32 network-byte-order conversion),Title,ToolTip,StatusActivate→TrayIconClickedEvent,SecondaryActivate→TrayIconDoubleClickedEvent,ContextMenu→TrayIconRightClickedEventorg.kde.StatusNotifierWatcher(KDE/Plasma) andcom.canonical.StatusNotifierWatcher(Ubuntu/GNOME) with graceful fallbackOpenContextMenu()usesPositioningStrategy::CursorPosition()to pop the GTK menu at pointer positionstd::atomic<int>src/platform/linux/tray_manager_linux.cpp— Removes all AppIndicator conditionals;IsSupported()probes D-Bus session bus availability (result cached)src/CMakeLists.txt— Dropsayatana-appindicator3-0.1pkg-config module and its link target.github/workflows/build.yml— Removeslibayatana-appindicator3-devfrom the Linux CI install stepOriginal prompt
This section details on the original issue you should resolve
<issue_title>[Linux]
libayatana-appindicatortroublesome</issue_title><issue_description>Rewritten with explicit separation of problems, causes, and solutions.
Summary
The library
libayatana-appindicator, currently used for Linux support, creates multiple issues for Linux distributions and downstream users. These issues fall into three main categories: packaging constraints, binary compatibility problems, and licensing risks.In practice, these issues arise because the library is being used where a simple D-Bus implementation would suffice, and the current dependency chain introduces unnecessary complexity.
Issues
1. Packaging problems on Linux distributions
Using
libayatana-appindicatoris difficult for many Linux distributions due to their packaging policies and Flutter’s installation model.Cause
Most distributions prohibit network access during package builds. Examples:
Gentoo packaging rules:
https://devmanual.gentoo.org/ebuild-writing/functions/src_test/index.html#tests-that-require-network-or-service-access
Debian policy:
https://www.debian.org/doc/debian-policy/ch-source.html
However Flutter itself often expects:
Flutter explicitly documents issues when installed in restricted locations:
https://docs.flutter.dev/install/troubleshoot#flutter-in-special-folders
Result
Package maintainers are forced to rely on prebuilt binaries rather than building from source.
2. Binary compatibility issues
Using prebuilt binaries introduces compatibility problems with system libraries.
Cause
The
libayatana-appindicatorlibraries installed by distributions can vary in:Examples from typical installations:
Prebuilt binaries may:
Additional complication
The library ecosystem has been forked and renamed multiple times, meaning different distributions may ship different implementations.
Examples:
Distribution renames and compatibility issues:
3. GPL licensing risk
A major issue is the license of the library.
libayatana-appindicatoris licensed under GPL-3.0:https://github.com/AyatanaIndicators/libayatana-appindicator/blob/main/COPYING
Cause
If a project links against a GPL library (including via FFI), the GPL's copyleft terms may apply to the entire program.
This can require the entire application to be distributed under GPL-compatible terms.
Result
This introduces a licensing contamination risk for downstream users, particularly those who wish to distribute closed-source software.
Root cause
After investigation,
libayatana-appindicatordoes not provide complex functionality.It is primarily an implementation of the StatusNotifierItem specification:
https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/
This specification simply defines a D-Bus interface for system tray indicators.
...
libayatana-appindicatortroublesome #42✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.