Skip to content

Commit

Permalink
fix: hide unused menu bar on Linux and Windows builds (#79)
Browse files Browse the repository at this point in the history
Menu bar is populated by default on Windows and Linux Electron builds even when not used.

This makes it so it is auto-hidden on dev builds (so it's still accessible if wanted), but fully disabled on "production" builds.
  • Loading branch information
pfeerick committed Apr 25, 2024
1 parent f912b8e commit c30d71f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const createWindow = (): void => {
titleBarStyle: "hidden",
resizable: !config.isProduction,
show: false,
autoHideMenuBar: true,
webPreferences: {
allowRunningInsecureContent: false,
// Need these enabled when e2e is running
Expand All @@ -70,6 +71,8 @@ const createWindow = (): void => {
} as electron.WebPreferences,
});

if (config.isProduction) mainWindow.setMenu(null);

if (config.startParams.isE2e) {
session
.fromPartition("default")
Expand Down

0 comments on commit c30d71f

Please sign in to comment.