Skip to content

Provide a way to skip adding the default Quit option #44

@lordmauve

Description

@lordmauve

I would like a way to avoid adding the default Quit option. I have two reasons:

  1. As my application heads towards production I don't want it to have a Quit option. The application will terminate itself in certain circumstances.
  2. 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().

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