From 74ae6b564b20e9b72e65a50055a4b52836ed142d Mon Sep 17 00:00:00 2001 From: Salah Benmoussati <51402489+sbenmoussati@users.noreply.github.com> Date: Tue, 28 Apr 2026 20:55:44 +0200 Subject: [PATCH] SDA-5024 Toggle fullscreen menu entry workaround on macOS (#2530) --- package.json | 2 +- src/app/app-menu.ts | 28 ++++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 82108e0f..1b18b53c 100644 --- a/package.json +++ b/package.json @@ -195,7 +195,7 @@ "cheerio": "v1.0.0-rc.12", "cross-env": "7.0.3", "del": "3.0.0", - "electron": "39.5.1", + "electron": "41.3.0", "electron-builder": "^26.3.1", "electron-devtools-installer": "^3.2.0", "electron-icon-maker": "0.0.5", diff --git a/src/app/app-menu.ts b/src/app/app-menu.ts index 8953e439..5b5b913f 100644 --- a/src/app/app-menu.ts +++ b/src/app/app-menu.ts @@ -400,14 +400,34 @@ export class AppMenu { 'zoomOut', ), this.buildSeparator(), - this.assignRoleOrLabel({ - role: 'togglefullscreen', - label: i18n.t('Toggle Full Screen')(), - }), + this.addToggleFullScreenMenuItem(), ], }; } + /** + * Creates a menu item to toggle full screen with different implementation for windows and macOS due to the difference in how full screen is handled in both OS + * @returns Menu item + */ + private addToggleFullScreenMenuItem(): Electron.MenuItemConstructorOptions { + if (isWindowsOS) { + return this.assignRoleOrLabel({ + role: 'togglefullscreen', + label: i18n.t('Toggle Full Screen')(), + }); + } else { + return { + label: i18n.t('Toggle Full Screen')(), + accelerator: 'Ctrl+Command+F', + click: (_item, focusedWindow) => { + if (focusedWindow) { + focusedWindow.setFullScreen(!focusedWindow.isFullScreen()); + } + }, + }; + } + } + /** * Builds menu items for window section */