-
Notifications
You must be signed in to change notification settings - Fork 25
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: Tray icon not working on Flatpak for Linux #232
Conversation
Reviewer's Guide by SourceryThis pull request improves the tray icon on Linux by using the correct icon brightness and using the installed tray icon when in a Flatpak environment to workaround filesystem differences between the sandboxed environment and the host. Sequence diagram for tray icon path resolutionsequenceDiagram
participant App
participant TrayManager
participant Platform
participant SchedulerBinding
App->>TrayManager: getTrayIconPath()
TrayManager->>Platform: isMacOS
alt is MacOS
Platform-->>TrayManager: true
TrayManager-->>App: assets/mac-tray.svg
else not MacOS
Platform-->>TrayManager: false
TrayManager->>SchedulerBinding: get platformBrightness
SchedulerBinding-->>TrayManager: current brightness
TrayManager->>Platform: isWindows
alt is Windows
Platform-->>TrayManager: true
TrayManager-->>App: assets/tray_icon_{brightness}.ico
else not Windows
Platform-->>TrayManager: false
TrayManager->>Platform: isLinux && FLATPAK_ID
alt is Linux Flatpak
Platform-->>TrayManager: true
TrayManager-->>App: ci.not.Rune-tray-{brightness}
else regular Linux
Platform-->>TrayManager: false
TrayManager-->>App: assets/linux-tray-{brightness}.svg
end
end
end
State diagram for tray icon path selectionstateDiagram-v2
[*] --> CheckPlatform
CheckPlatform --> MacOS: Platform.isMacOS
CheckPlatform --> GetBrightness: !Platform.isMacOS
MacOS --> [*]: Return mac-tray.svg
GetBrightness --> Windows: Platform.isWindows
GetBrightness --> Linux: !Platform.isWindows
Windows --> [*]: Return tray_icon_{brightness}.ico
Linux --> FlatpakCheck
FlatpakCheck --> LinuxFlatpak: FLATPAK_ID exists
FlatpakCheck --> RegularLinux: FLATPAK_ID not exists
LinuxFlatpak --> [*]: Return ci.not.Rune-tray-{brightness}
RegularLinux --> [*]: Return linux-tray-{brightness}.svg
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Fei1Yang - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
* fix: Use correct brightness for Linux tray icon * fix: Use installed tray icon when in Flatpak
This pull request will:
Summary by Sourcery
Use the correct tray icon brightness on Linux. When running in a Flatpak environment, use the installed tray icon to resolve filesystem discrepancies between the sandboxed environment and the host.
New Features:
Enhancements: