Skip to content

Conversation

@ibetitsmike
Copy link
Contributor

@ibetitsmike ibetitsmike commented Dec 18, 2025

Summary

Fixes #1100 - Cmd+Q now properly quits the app on macOS instead of closing/hiding the window first.

Problem

Pressing Cmd+Q was behaving like Cmd+W (closing the window first) instead of immediately quitting the app. The app would only quit on a second Cmd+Q press after the window was already closed.

Root Cause

The menu structure had { role: "close" } in the Window menu for all platforms. On macOS, this may have caused accelerator registration conflicts where Cmd+Q was triggering the window close action instead of the app quit action.

Solution

Updated the menu structure to follow the official Electron documentation pattern:

macOS:

  • App menu: About, Settings, Services, Hide/HideOthers/Unhide, Quit (⌘Q)
  • File menu: Close (⌘W)
  • Window menu: Minimize, Zoom (no Close)

Windows/Linux:

  • File menu: Quit
  • Window menu: Minimize, Close

This matches standard macOS application behavior where:

  • close lives in the File menu (not Window menu)
  • Window menu contains window management items (minimize, zoom)

Testing

  • Verify Cmd+Q immediately quits the app on macOS (doesn't close window first)
  • Verify Cmd+W still closes the window on macOS
  • Verify clicking "Quit" from menu bar still works
  • Verify Windows/Linux behavior is unchanged

Generated with mux • Model: mux-gateway:anthropic/claude-opus-4-5 • Thinking: high

Adding detailed logging to understand why Cmd+Q closes the window instead
of quitting the app on macOS:

- Quit menu item click handler
- mainWindow 'close' and 'closed' events
- app 'before-quit' event with disposal state
- app 'window-all-closed' event
- Cmd+Q detection in renderer (to see if keypress reaches renderer)

Run the app and press Cmd+Q, then check the console output.

Fixes #1100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

On Mac, pressing ⌘+Q doesn't quit Mux

1 participant