Skip to content

Build your personal knowledge base with Trilium Notes

fix(native-buttons): enable buttons on other windows as well

Elian Doran45faa666bad9
diff --git a/src/services/window.ts b/src/services/window.ts
index 370df0e639..f60c5f783a 100644
--- a/src/services/window.ts
+++ b/src/services/window.ts
@@ -31,7 +31,7 @@ async function createExtraWindow(extraWindowHash: string) {
contextIsolation: false,
spellcheck: spellcheckEnabled
},
- frame: optionService.getOptionBool('nativeTitleBarVisible'),
+ ...getWindowExtraOpts(),
icon: getIcon()
});
@@ -71,11 +71,7 @@ async function createMainWindow(app: App) {
const { BrowserWindow } = (await import('electron')); // should not be statically imported
- const extraOpts: Partial<BrowserWindowConstructorOptions> = {};
- if (!optionService.getOptionBool('nativeTitleBarVisible')) {
- extraOpts.titleBarStyle = "hidden";
- extraOpts.titleBarOverlay = (process.platform !== "darwin");
- }
+
mainWindow = new BrowserWindow({
x: mainWindowState.x,
@@ -90,7 +86,7 @@ async function createMainWindow(app: App) {
webviewTag: true
},
icon: getIcon(),
- ...extraOpts
+ ...getWindowExtraOpts()
});
mainWindowState.manage(mainWindow);
@@ -116,6 +112,16 @@ async function createMainWindow(app: App) {
});
}
+function getWindowExtraOpts() {
+ const extraOpts: Partial<BrowserWindowConstructorOptions> = {};
+ if (!optionService.getOptionBool('nativeTitleBarVisible')) {
+ extraOpts.titleBarStyle = "hidden";
+ extraOpts.titleBarOverlay = (process.platform !== "darwin");
+ }
+
+ return extraOpts;
+}
+
function configureWebContents(webContents: WebContents, spellcheckEnabled: boolean) {
remoteMain.enable(webContents);