Skip to content

Commit

Permalink
Fix new window issue on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
alexk111 committed Apr 14, 2024
1 parent 7cbd2da commit f0f5108
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
7 changes: 7 additions & 0 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ if (!app.requestSingleInstanceLock()) {
}
)

app.on('browser-window-created', (_e, win) => {
// Disable menu in child windows
if (win !== appWindow) {
win.removeMenu();
}
});

initTrayUseCase(appWindow);
})
});
Expand Down
26 changes: 18 additions & 8 deletions src/main/infra/browserWindow/browserWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,24 @@ export function createRendererWindow(
parent: win,
title: 'Freeter',
}
if (process.platform === 'win32') {
browserWinOpts = {
...browserWinOpts,
frame: false,
thickFrame: true,
modal: true,
titleBarOverlay: true,
titleBarStyle: 'hidden'
switch (process.platform) {
case 'linux': {
browserWinOpts = {
...browserWinOpts,
modal: true,
}
break;
}
case 'win32': {
browserWinOpts = {
...browserWinOpts,
frame: false,
thickFrame: true,
modal: true,
titleBarOverlay: true,
titleBarStyle: 'hidden'
}
break;
}
}
return {
Expand Down

0 comments on commit f0f5108

Please sign in to comment.