Skip to content
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

Application exits prematurely if QSystemTrayIcon.isSystemTrayAvailable() is false #97

Open
huantianad opened this issue Mar 29, 2023 · 0 comments

Comments

@huantianad
Copy link
Contributor

On startup, aw-qt checks if QSystemTrayIcon.isSystemTrayAvailable() is false. If there isn't a system tray available, it simply exits since it cannot show an icon. This behavior makes sense most of the time.

However, on my system running KDE Plasma 5.27.3 (and I'd assume other Plasma systems), autostart programs are called before the panel containing a system tray is loaded. This causes aw-qt to crash on startup, as it tries to find a system tray, but Plasma has not yet loaded it.

This can simply be fixed by skipping or delaying the check to QSystemTrayIcon.isSystemTrayAvailable(). According to the QT docs, "If the system tray is currently unavailable but becomes available later, QSystemTrayIcon will automatically add an entry in the system tray if it is visible." Therefore, even if on startup QSystemTrayIcon.isSystemTrayAvailable() is false, QSystemTrayIcon will still properly display once the system tray is loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant