From b4a1d34caedec0a243539b42558b4d94b1a8e778 Mon Sep 17 00:00:00 2001 From: Muffin Date: Thu, 14 Dec 2023 13:06:43 -0600 Subject: [PATCH] Restore cmd+w to close window on macOS closes https://github.com/TurboWarp/desktop/issues/877 --- src-main/l10n/en.json | 4 ++++ src-main/menu-bar.js | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src-main/l10n/en.json b/src-main/l10n/en.json index 6faa78f7..6ba43d4a 100644 --- a/src-main/l10n/en.json +++ b/src-main/l10n/en.json @@ -35,6 +35,10 @@ "string": "New Window", "developer_comment": "macOS menu bar item to open a new editor window" }, + "menu.close-window": { + "string": "Close Window", + "developer_comment": "macOS menu bar item to close the current window" + }, "menu.settings": { "string": "Settings", "developer_comment": "macOS menu bar item to open desktop settings window" diff --git a/src-main/menu-bar.js b/src-main/menu-bar.js index ad3eb7c1..a3bea96f 100644 --- a/src-main/menu-bar.js +++ b/src-main/menu-bar.js @@ -81,6 +81,13 @@ const rebuildMenuBar = () => { PackagerWindow.forEditor(window); } } + }, + { + label: translate('menu.close-window'), + accelerator: 'Cmd+W', + click: (menuItem, browserWindow) => { + browserWindow.close(); + } } ] },