From f531750d0c114c180c5ffc00324eccfa0d305602 Mon Sep 17 00:00:00 2001 From: Ian Holloway Date: Fri, 18 Apr 2025 16:13:09 -0700 Subject: [PATCH 1/2] Enable macOS traffic light controls in main window --- sources/code/main/windows/main.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sources/code/main/windows/main.ts b/sources/code/main/windows/main.ts index d08b1cad..bbfe34d0 100644 --- a/sources/code/main/windows/main.ts +++ b/sources/code/main/windows/main.ts @@ -52,6 +52,10 @@ export default function createMainWindow(...flags:MainWindowFlags): BrowserWindo backgroundColor: appInfo.backgroundColor, transparent: appConfig.value.settings.general.window.transparent, show: false, + ...(process.platform === "darwin" && { + titleBarStyle: "hiddenInset", + trafficLightPosition: { x: 10, y: 10 }, + }), webPreferences: { preload: resolve(app.getAppPath(), "app/code/renderer/preload/main.js"), nodeIntegration: false, // Never set to "true"! From 1d8b5aab75d23e89325b33d3976dea0da28be13e Mon Sep 17 00:00:00 2001 From: SpacingBat3 Date: Mon, 21 Apr 2025 16:58:13 +0200 Subject: [PATCH 2/2] Add config for macOS traffic light placement. --- sources/code/main/modules/config.ts | 3 +++ sources/code/main/windows/main.ts | 2 +- sources/translations/en/settings.json | 7 +++++++ sources/translations/pl/settings.json | 7 +++++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/sources/code/main/modules/config.ts b/sources/code/main/modules/config.ts index 98e70f24..96eacaf3 100644 --- a/sources/code/main/modules/config.ts +++ b/sources/code/main/modules/config.ts @@ -64,6 +64,9 @@ const defaultAppConfig = Object.freeze({ window: { transparent: false, hideOnClose: true + }, + darwin: { + csd: false } }, privacy: { diff --git a/sources/code/main/windows/main.ts b/sources/code/main/windows/main.ts index bbfe34d0..a476664d 100644 --- a/sources/code/main/windows/main.ts +++ b/sources/code/main/windows/main.ts @@ -52,7 +52,7 @@ export default function createMainWindow(...flags:MainWindowFlags): BrowserWindo backgroundColor: appInfo.backgroundColor, transparent: appConfig.value.settings.general.window.transparent, show: false, - ...(process.platform === "darwin" && { + ...(process.platform === "darwin" && appConfig.value.settings.general.darwin.csd && { titleBarStyle: "hiddenInset", trafficLightPosition: { x: 10, y: 10 }, }), diff --git a/sources/translations/en/settings.json b/sources/translations/en/settings.json index 44a13ed7..d260ec61 100644 --- a/sources/translations/en/settings.json +++ b/sources/translations/en/settings.json @@ -30,6 +30,13 @@ "transparent": "Allow for translucent window background.", "hideOnClose": "Hide window to tray with the close button." } + }, + "darwin": { + "name": "macOS related settings", + "description": "Controls integrations with macOS system.", + "labels": { + "csd": "Enable client-side traffic lights placement." + } } }, "privacy": { diff --git a/sources/translations/pl/settings.json b/sources/translations/pl/settings.json index 1a8a4310..4be32254 100644 --- a/sources/translations/pl/settings.json +++ b/sources/translations/pl/settings.json @@ -30,6 +30,13 @@ "transparent": "Zezwól na przezroczyste tło okna.", "hideOnClose": "Ukrywaj okno do zasobnika przyciskiem zamykania." } + }, + "darwin": { + "name": "Ustawienia dla systemu macOS", + "description": "Steruje integracją z systemem macOS.", + "labels": { + "csd": "Włącz pozycjonowanie sygnalizacji świetlnej po stronie klienta." + } } }, "privacy": {