Reimplement Linux TrayIcon using libayatana-appindicator-glib to replace deprecated GtkStatusIcon #24
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.
Overview
This PR modernizes the Linux tray icon implementation by replacing the deprecated
GtkStatusIconAPI withlibayatana-appindicator3, eliminating deprecation warnings and providing better desktop integration.Problem
The current Linux tray icon implementation uses
GtkStatusIcon, which has been deprecated since GTK 3.14 and generates numerous compiler warnings:The deprecated API is no longer maintained and doesn't integrate well with modern Linux desktop environments that have moved to the StatusNotifierItem/AppIndicator standard.
Solution
Complete API Migration
GtkStatusIcon*withAppIndicator*in theTrayIcon::ImplclassTrayManager::Create()to useapp_indicator_new()instead ofgtk_status_icon_new()Build System Updates
ayatana-appindicator3-0.1as a required dependency in CMakeLists.txtPkgConfig::AYATANA_APPINDICATORin the build configurationKey Implementation Changes
Icon Management:
Visibility Control:
Context Menus:
Context menus are now natively handled by the AppIndicator framework, providing better integration with system tray implementations across different desktop environments.
Benefits
Testing
Notes
The implementation maintains backward compatibility while modernizing the underlying technology stack for better long-term maintainability and user experience.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com/usr/lib/apt/methods/https(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.