diff --git a/docs/subsystems/gui-shell.md b/docs/subsystems/gui-shell.md
index 00fc9bb9e..aed8fe484 100644
--- a/docs/subsystems/gui-shell.md
+++ b/docs/subsystems/gui-shell.md
@@ -37,6 +37,7 @@ three.
7. The page's header is the window's title bar. `plainTitlebar` sets it up once the app has started, and again on a window lightweight mode made again (`madeAgain`). On Linux it hides GTK's title bar and keeps the shadow and the resize edges; GTK 3 leaves the corners square. On the Mac the traffic lights are inset into the header (`MacTitleBarHiddenInset`). In the design of macOS 26 a window with a toolbar has larger corners than one with a plain title bar, so `insetLights` ([`titlebar_darwin.go`](../../internal/gui/titlebar_darwin.go)) takes the toolbar off, and `MagpieLights` keeps the lights and the title bar's height where the toolbar had them: after a resize, a new title, light or dark, more contrast or less transparency, and leaving full screen. A sheet, such as the folder chooser, still begins below the title bar. A first press while another app is in front still moves the window from anywhere in that title bar (`firstPress`), as AppKit moved it with the toolbar; AppKit itself now does so only in a plain title bar's top 32pt. AppKit gives a program that design from macOS 26 when the program is linked against the macOS 26 SDK or a later one and its Info.plist doesn't ask for the earlier design (`UIDesignRequiresCompatibility`); `designOf26` reads each at run time, as the SDK depends on the toolchain that built magpie. The toolbar stays in the earlier design, where it doesn't change the corners, with the lights on the right (a right-to-left language), or when the title bar isn't laid out as expected; this is decided once, when the window is set up. In full screen the title bar is AppKit's own. Windows keeps its own title bar.
8. On the Mac, Settings › Show in Dock puts magpie in the Dock never (`DockNever`), while the window is open (the default; `DockWindow` records it chosen, for an older magpie that took none for never) or always (`Dock`, which wins). The default was never until ShouguangCao on X found the open window out of Command-Tab, so going back to it to paste a key copied elsewhere took the menu bar; a new install (no settings.json) reads With window, and Hide is a choice of its own (`inDock`, `dockChoice` in app.js, `TestDockFollowsWindowByDefault`, `dock-choice.test.cjs`). A file written before that has no `dockSettled`, and stored Hide as nothing, so a user who chose Hide can't be told from one who never chose: such a file with no Dock choice reads as Hide, and the first save writes it so with `dockSettled` (`settleDock`, `TestOlderSettingsKeepHide`, `TestNewInstallFollowsWindow`). A file nobody can read reads the same way. The page never sends `dockSettled`; the save keeps the file's (`TestSettingsSaveKeepsDockReading`). It is this computer's own, as the Dock choice is (`KeepOwn`). A full-screen window joins it whatever the setting (`inDock`, `dockOnFullscreen`). `openMain` joins before it shows the window (`setDock` runs on the main thread at once). An app activated out of the Dock (the quick panel's focus) that then joins it stays last in Command-Tab's order though it is in front, so joining to the front activates magpie by way of the Dock (`dockStep`, `activateAgain`; #1381, `TestDockStep`, `TestDockJoinLeadsCommandTab`). It does so without asking NSApp whether magpie is active: the Mac makes it the front app at once, and NSApp says so only once the main thread has taken that in, after the join on a busy Mac (#1651).
9. Settings › General › Quick panel shortcut binds a key combination that opens the tray's panel from any app (ben hanks on Discord); none is set by default. The page records the keys and posts them to `POST /api/settings/panel-shortcut`, which checks them (`panelShortcut`: a letter, digit, Space or F1–F20 with Ctrl, Alt/Option or Cmd/Super, or an F key alone, written as Wails' accelerator), has the running app bind them (`onPanelShortcut`, `bindPanelKey` through Wails' `GlobalShortcut`: Carbon's hot keys on the Mac, `RegisterHotKey` on Windows, `XGrabKey` on X11) and saves them only once bound. One the system refuses (on Windows and X11, another app holding it) is not saved and the old one stays bound; one saved but refused as magpie starts is retried after a handed-over magpie exits and else said in the row (`panelKeysJSON.Taken`). A pressed shortcut toggles the panel as a tray click does (`togglePanel`). The Mac's Carbon hot keys don't refuse a combination another app registered too, so there both are taken and magpie can't tell the user. The shortcut is per computer (`KeepOwn`), and the Mac's old process lets go of it as it hands over (`leaveMenuBar`). On Wayland no app may grab keys itself, so the field is off and the row says the command to bind in the desktop's own keyboard settings (`magpie panel`); Wails' GlobalShortcuts portal is not used, since the compositor decides its keys and Hyprland binds none unless configured. From there a not-connected Claude Code's or Codex's opened row switches its account (shuizhuyu on X, [Switch accounts only](providers-accounts.md)).
+10. A click on the tray icon opens the quick panel, or the main window when Settings › General › Click the tray icon to says so. The panel opens the main window from the header's icon (`#open`, named "Open the main window"; its foot keeps Profiles, the status line and Quit, `panel-open-once.test.cjs`). On Windows a double-click on the icon opens the main window too (isaac_bai on Discord): Wails passes the icon's `WM_LBUTTONDBLCLK` on as `OnDoubleClick`, the panel its first click opened is hidden by `openMain`, and the `WM_LBUTTONUP` that ends the double-click is swallowed once (`trayDouble`, within `trayDoubleRelease`) so it does not open the panel over the window. The Mac's status item calls its action on each mouse-down with no click count, and Linux's StatusNotifierItem has only `Activate`, so there a double-click is two clicks and is left as such (`trayDoubleClicks`, `TestTrayDoubleClickOpensTheWindowOnWindowsOnly`, `TestTrayDoubleClickReleaseSwallowedOnce`; [`traydouble.go`](../../internal/gui/traydouble.go)).
## Constraints and failure behavior
diff --git a/internal/gui/app.go b/internal/gui/app.go
index 8503309c8..eac0a2ac8 100644
--- a/internal/gui/app.go
+++ b/internal/gui/app.go
@@ -619,9 +619,22 @@ func Run(version string, showMain bool, link string) error {
h.setTrayInBar(barIcon(h)["on"])
go h.lighten()
h.watchAlerts()
+ // a double-click opens the main window where the tray tells one apart
+ // (trayDoubleClicks: Windows); its first click opened the panel, which
+ // openMain hides, and its last release is no click of its own
+ var double trayDouble
+ if trayDoubleClicks(runtime.GOOS) {
+ h.tray.OnDoubleClick(func() {
+ double.doubled(time.Now())
+ h.ShowMain("")
+ })
+ }
// the quick panel by the icon, or the main window if the user would
// rather (Settings → Click the tray icon to)
h.tray.OnClick(func() {
+ if double.swallow(time.Now()) {
+ return
+ }
if cmdClick() {
return // Command-drag moves the icon; the system handles it
}
diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js
index 9c496571f..538b8ec56 100644
--- a/internal/gui/assets/i18n.js
+++ b/internal/gui/assets/i18n.js
@@ -565,7 +565,6 @@ const I18N = {
"Agents looked for again": "已重新检测 Agent",
"Usage refreshed": "用量已刷新",
"Allowances refreshed": "额度已刷新",
- "Open as a window": "在窗口中打开",
"Quit": "退出",
"Filter…": "筛选…",
@@ -5134,7 +5133,6 @@ const I18N = {
"Agents looked for again": "已重新檢測 Agent",
"Usage refreshed": "用量已重新整理",
"Allowances refreshed": "額度已重新整理",
- "Open as a window": "在視窗中開啟",
"Quit": "退出",
"Filter…": "篩選…",
"No agents found": "沒有找到 Agent",
@@ -9665,7 +9663,6 @@ const I18N = {
"Agents looked for again": "エージェントを再検出しました",
"Usage refreshed": "使用量を更新しました",
"Allowances refreshed": "利用枠を更新しました",
- "Open as a window": "ウィンドウで開く",
"Quit": "終了",
"Filter…": "絞り込み…",
"No agents found": "エージェントが見つかりません",
@@ -14214,7 +14211,6 @@ const I18N = {
"Agents looked for again": "Agenten erneut gesucht",
"Usage refreshed": "Nutzung aktualisiert",
"Allowances refreshed": "Kontingente aktualisiert",
- "Open as a window": "Als Fenster öffnen",
"Quit": "Beenden",
"Filter…": "Filtern…",
"No agents found": "Keine Agenten gefunden",
diff --git a/internal/gui/assets/index.html b/internal/gui/assets/index.html
index 5188b63da..2da2c1f4a 100644
--- a/internal/gui/assets/index.html
+++ b/internal/gui/assets/index.html
@@ -92,7 +92,7 @@
-