Skip to content

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

@huantianad

Description

@huantianad

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions