hydrusnetwork / hydrusnetwork/hydrus
Tray icon goes blank after closing to tray
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.2k
- Forks
- 207
- PR merge metrics
- No merged PRs in 30d
Description
Hydrus version
v683
Qt major version
Qt 6
Operating system
Linux (specify distro and version in comments)
Install method
Third party (AUR, Docker, Chocolatey, etc. Specify in comments)
Install and OS comments
I'm running NixOS and have Hydrus installed through nixpkgs.
Bug description and reproduction
I have Hydrus set to close to tray, and in my system tray (polybar) the Hydrus icon goes blank once it's hidden. Showing Hydrus again makes the icon visible again. It only happens after a show and then a hide; if Hydrus boots straight into the tray there's no issue.
I managed to fix the issue with Claude, and it seems to be working without issue:
_SystemTrayHidehides every visible top level widget, andQSystemTrayIconcreates its own top level window, so the tray icon gets hidden along with the GUI.QSystemTrayIcon.isVisible()still returns True afterwards, so theshow()in_UpdateSystemTrayIconis a no-op and nothing brings the icon back._SystemTrayShowre-shows everything it hid, including that window, which is why showing the client makes the icon reappear.Skipping that window in the sweep is a one line fix:
visible_tlws = [ tlw for tlw in QW.QApplication.topLevelWidgets() if ( tlw.isVisible() or tlw.isMinimized() ) and tlw.metaObject().className() != 'QSystemTrayIconSys' ]Matching on the class name is a bit gross;
BypassWindowManagerHintis public API and is also set on that window, but it's broader.
Claude's fix is here on my fork. https://github.com/ElnuDev/hydrus/commit/8dcd4677
I've tested this on v683, but this should work in v687 as well.
Thank you!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating _SystemTrayHide, _SystemTrayShow, and _UpdateSystemTrayIcon, then reproduce a show-and-hide cycle on Linux with Qt 6. Check how top-level widgets are selected during hiding and how the tray icon is updated. Done means the icon remains visible after the application is hidden and reappears when the application is shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, python
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 74/100