Skip to content

Linux: System tray 'Quit' does not exit the app — must force quit #14

Closed

Description

@khaira777

Description

After minimizing to the system tray on Linux/Ubuntu, right-clicking the tray icon and selecting Quit does nothing. The app stays running and must be force-quit from the system monitor.

The tray Show option works fine — only Quit is broken.

Steps to Reproduce

  1. Launch Flo Cafe on Linux/Ubuntu
  2. Close the window — app minimizes to system tray
  3. Right-click the tray icon
  4. Click Quit
  5. App does not exit; process remains alive

Expected Behavior

Clicking Quit in the system tray context menu should cleanly terminate the app (tear down DB, servers, mDNS, destroy tray icon, exit process).

Current Behavior

Nothing happens. The app continues running in the background with no visible window and no tray icon interaction.

Investigation Notes

The tray Quit handler in main/index.ts does:

click: () => {
  isQuitting = true;
  app.quit();
}

This works on macOS/Windows but on Linux/Electron app.quit() can fail to terminate the process — especially when the window is minimized (not hidden) and the tray is the only remaining UI reference. The will-quit event may never fire, leaving the process stranded.

Possible fixes to explore:

  • Use app.exit(0) as a fallback after a short timeout if will-quit hasn't fired
  • Ensure the window is destroyed before calling app.quit() on Linux
  • Listen for the closed event on the window before calling app.quit()

Environment

  • OS: Linux/Ubuntu
  • Electron system tray via Tray + Menu
  • Window close is intercepted to minimize (not hide) on Linux

Activity

  1. added theissue type on Jul 6, 2026
  2. khaira777 commented on Jul 10, 2026

    @khaira777
    ContributorAuthor

    Verified on Debian 13. The AppIndicator deadlock has been resolved by deferring the teardown execution and explicitly destroying the tray lock. Additionally, the window close behavior has been standardized to cleanly hide the app into the tray, ensuring it acts as a persistent background POS. Fix merged in PR #72.

  3. self-assigned this
    on Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions