From 7d30dcdb47435208f7424cc53c8ba08d054c3d26 Mon Sep 17 00:00:00 2001 From: V Date: Fri, 19 Jan 2024 00:01:30 +0100 Subject: [PATCH] Make popouts respect the menu bar visibility setting --- src/main/utils/popout.ts | 5 ++++- src/renderer/components/Settings.tsx | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/utils/popout.ts b/src/main/utils/popout.ts index 8070449..cdeea61 100644 --- a/src/main/utils/popout.ts +++ b/src/main/utils/popout.ts @@ -49,7 +49,8 @@ const DEFAULT_POPOUT_OPTIONS: BrowserWindowConstructorOptions = { webPreferences: { nodeIntegration: false, contextIsolation: true - } + }, + autoHideMenuBar: Settings.store.enableMenu }; export const PopoutWindows = new Map(); @@ -98,6 +99,8 @@ export function createOrFocusPopup(key: string, features: string) { } export function setupPopout(win: BrowserWindow, key: string) { + win.setMenuBarVisibility(false); + PopoutWindows.set(key, win); /* win.webContents.on("will-navigate", (evt, url) => { diff --git a/src/renderer/components/Settings.tsx b/src/renderer/components/Settings.tsx index b9ef4d6..eb0387f 100644 --- a/src/renderer/components/Settings.tsx +++ b/src/renderer/components/Settings.tsx @@ -41,7 +41,11 @@ export default function SettingsUi() { "Allows you to make the window as small as your heart desires" ], ["staticTitle", "Static Title", 'Makes the window title "Vesktop" instead of changing to the current page'], - ["enableMenu", "Enable Menu Bar", "Enables the application menu bar. Press ALT to toggle visibility."], + [ + "enableMenu", + "Enable Menu Bar", + "Enables the application menu bar. Press ALT to toggle visibility. Incompatible with 'Discord Titlebar'" + ], ["disableSmoothScroll", "Disable smooth scrolling", "Disables smooth scrolling in Vesktop", false], ["hardwareAcceleration", "Hardware Acceleration", "Enable hardware acceleration", true], ["splashTheming", "Splash theming", "Adapt the splash window colors to your custom theme", false],