From 614e5bb368112d2a15f77539f4e9a261cf3ba1de Mon Sep 17 00:00:00 2001 From: Sandeep Singh Date: Wed, 26 Nov 2025 16:44:17 +0530 Subject: [PATCH] fix: resolve full screen error in keybindings and menu integration --- js/defaultKeybindings.js | 5 +++++ main/menu.js | 18 +++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/js/defaultKeybindings.js b/js/defaultKeybindings.js index f1286334d..cd139e0ad 100644 --- a/js/defaultKeybindings.js +++ b/js/defaultKeybindings.js @@ -151,6 +151,11 @@ const defaultKeybindings = { modalMode.onDismiss = null } + // enter full screen mode +keybindings.defineShortcut('toggleFullscreen', function () { + ipc.invoke('setFullScreen', true) +}) + // exit full screen mode webviews.callAsync(tabs.getSelected(), 'executeJavaScript', 'if(document.webkitIsFullScreen){document.webkitExitFullscreen()}') diff --git a/main/menu.js b/main/menu.js index 4e5e3a6c5..0bb5c44ce 100644 --- a/main/menu.js +++ b/main/menu.js @@ -287,13 +287,17 @@ function buildAppMenu (options = {}) { } } }, - { - label: l('appMenuFullScreen'), - accelerator: (function () { - if (process.platform == 'darwin') { return 'Ctrl+Command+F' } else { return 'F11' } - })(), - role: 'togglefullscreen' - } + { + label: l('appMenuFullScreen'), + accelerator: (function () { + if (process.platform == 'darwin') { return 'Ctrl+Command+F' } else { return 'F11' } + })(), + click: function (item, focusedWindow) { + if (focusedWindow) { + focusedWindow.setFullScreen(!focusedWindow.isFullScreen()) + } + } +} ] }, {