Repository navigation
Tray icon and background host fixes - #32
Merged
Merged
Conversation
…e appearance check, one Open at a time - macOS fires the tray icon's action on the single click that opens its menu; only Windows and Linux open the app from it now. - macDarkMenuBar waits (2 s) before reading, so a hung `defaults` can't stall the host's main loop. - A second Open while the app started by the first is still running does nothing, instead of starting a second app that fails with "already running". - The appearance flag is read and written only on the event thread; the icon is removed once after Hide This Icon, not every tick. - Comments call the host the background host, not the headless MCP host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cleanly on Windows - On Linux the host no longer connects to the display just to find out there is no tray: a short-lived --tray-probe process asks, and the host stays headless unless it finds one, so logging out of the desktop can't end MCP and the phone page. - The app stops the host with a stop request (mcp-host.stop, naming the host's pid and start time) as well as SIGTERM. Windows gets only the request, since destroy() there ends the process without running its shutdown hook; the host exits cleanly and its tray icon goes with it. The force-stop after the wait still applies. - The shutdown hook waits (up to 1 s) for the icon to be removed instead of queueing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups to #7 from a code review of the tray icon.
Tray icon
defaultscan't stall the host's main loop.Background host
--tray-probeprocess asks, and the host stays headless unless the probe finds a tray. Logging out of the desktop can therefore no longer end MCP and the phone page while sessions keep running.mcp-host.stop, naming the host's pid and start time) as well as a signal. Windows gets only the request, becausedestroy()there is TerminateProcess, so the shutdown hook never ran and a dead tray icon was left behind. The host polls for the request every 250 ms and exits cleanly. If the host has not exited after the existing wait, it is still force-stopped.Testing
mvn -pl app -am test: 639 tests pass, including a new one for stop requests (a stale request for an earlier host with the same pid is ignored).--tray-probeon macOS: it exits 0 normally and 3 under-Djava.awt.headless=true.🤖 Generated with Claude Code