Skip to content
This repository has been archived by the owner on Jun 29, 2019. It is now read-only.

Commit

Permalink
Fix wrong vibrancy options in macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Heejin Lee committed May 13, 2018
1 parent f7cadf6 commit 044ba6c
Showing 1 changed file with 27 additions and 15 deletions.
42 changes: 27 additions & 15 deletions app/main/server/app/ui/main-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,32 @@ const RpcChannel = require('../../../shared/rpc-channel');

const ipc = electron.ipcMain;

function createWindowOptions() {
let options = {
width: 800,
height: 530,
alwaysOnTop: true,
center: true,
frame: false,
show: false,
closable: false,
minimizable: false,
maximizable: false,
moveable: false,
resizable: false,
skipTaskbar: true
};
const isDarwin = process.platform === 'darwin';
if (isDarwin) {
options = {
...options,
titleBarStyle: 'hidden',
vibrancy: 'popover'
};
}
return options;
}

module.exports = class MainWindow {
constructor(workerProxy, appPref) {
this.workerProxy = workerProxy;
Expand All @@ -24,21 +50,7 @@ module.exports = class MainWindow {
}

createWindow(onComplete) {
const browserWindow = new BrowserWindow({
width: 800,
height: 530,
alwaysOnTop: true,
center: true,
frame: false,
show: false,
closable: false,
minimizable: false,
maximizable: false,
moveable: false,
resizable: false,
skipTaskbar: true
});

const browserWindow = new BrowserWindow(createWindowOptions());
if (onComplete) browserWindow.webContents.on('did-finish-load', onComplete);

browserWindow.webContents.on('new-window', (evt, url) => {
Expand Down

0 comments on commit 044ba6c

Please sign in to comment.