Skip to content

Icon Disappears When I Lock My Ubuntu 22 Computer #186

@coder0xff

Description

@coder0xff

When I lock my Ubuntu 22 computer, the _xorg.py _on_destroy_notify runs. It calls self._assert_docked and catches AssertionException, logs, and continues. When I unlock my computer, I see the logged error, but there's no icon. There's also no way for my program to be notified. As error handling goes, loud failure is preferable to silent failure.

There are two possible improvements. The first is to fix the icon disappearing. The second is to allow the application using pystray to be aware of problems so it can take action.

My workaround is to run this code every second in another thread. It produces an AssertionError every second when the computer is locked. But once unlocked the icon is restored.

my_icon: Icon
temp = my_icon.icon
my_icon.icon = temp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions