-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
I would like a way to avoid adding the default Quit option. I have two reasons:
- As my application heads towards production I don't want it to have a Quit option. The application will terminate itself in certain circumstances.
- Right now I'm struggling with an issue that is causing deadlocks.
I don't fully understand the deadlock issue but it is bad interaction across threads and it is somehow related to the unique wiring that the "on_quit" option has. The short story is that this works perfectly:
server = ...
tray = SysTrayIcon(..., menu_options=(("Quit", None, server.cancel),))
tray._menu_options.pop()
with tray:
await server.run()While
server = ...
with SysTrayIcon(..., on_quit=server.cancel):
await server.run()causes deadlocks on context manager exit in any situation other than clicking the "Close" button on the menu, due to some internals of server.cancel().
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels