Skip to main content

Module lifecycle

Module lifecycle 

Source
Expand description

Window, tray, single-instance, and autostart lifecycle helpers.

Structs§

LifecycleState
Quit and activation requests shared between the tray, window, and single-instance handler.

Enums§

CloseDecision
What closing the main window does.
LifecycleError
Why a window, tray, or autostart change failed. Displays as a user-facing message.

Constants§

MAIN_WINDOW_LABEL
Window label of the main app window.
TRAY_ID
ID of the system tray or menu bar icon.
TRAY_OPEN_ID 🔒
Tray menu item that shows the main window.
TRAY_QUIT_ID 🔒
Tray menu item that quits the app.
TRAY_SAFE_MODE_ID 🔒
Tray menu item that restarts without widgets.

Functions§

activate_or_defer
Restores the main window, or remembers the request until the window exists.
apply_pending_activation
Restores the main window if a second launch asked for it earlier.
decide_close
Hides to the tray only when background mode is on, the tray exists, and the user didn’t choose Quit.
handle_close_request
Applies the close decision to the main window. If hiding fails, the window is shown again and an error is returned instead of leaving it invisible.
install_tray
Adds the tray icon with Open, Restart without widgets, and Quit items. Does nothing when the icon already exists.
restore_main_window
Shows, unminimizes, and focuses the main window and restores its taskbar button.