Add compatibility for Ayatana AppIndicator while retaining backward compatibility #8
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.
This update enables runcat-tray to work seamlessly on more recent systems that use the updated
ayatana-appindicatorpackages, while maintaining backward compatibility with older systems relying on the legacylibappindicator.Two main changes were made:
1. CMakeLists.txt update:
Modified the package detection logic to first attempt finding the legacy appindicator3-0.1 package, and if not found, fall back to the modern ayatana-appindicator3-0.1 package. This includes defining a USE_AYATANA macro when the Ayatana package is detected to allow conditional compilation.
2. Conditional includes in main.c:
Adjusted the source code to conditionally include the appropriate header file based on the presence of the USE_AYATANA macro. This allows compiling against either the legacy or the Ayatana AppIndicator headers without manual intervention.
These improvements ensure that runcat-tray builds and runs correctly across a wider range of Linux distributions and versions, accommodating the transition from libappindicator to Ayatana’s fork.