Skip to content

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

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions