[MM-22751] Removed Windows 10 style border for non-Windows 10 clients (#1322)

* [MM-22751] Removed Windows 10 style border for non-Windows 10 clients

* Lint fix
This commit is contained in:
Devin Binnie
2020-06-17 14:54:42 -04:00
committed by GitHub
parent d49e8dd501
commit 81522a3b2d
3 changed files with 12 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
// See LICENSE.txt for license information.
import fs from 'fs';
import path from 'path';
import os from 'os';
import {app, BrowserWindow} from 'electron';
@@ -19,6 +20,10 @@ function saveWindowState(file, window) {
}
}
function isFramelessWindow() {
return os.platform() === 'darwin' || (os.platform() === 'win32' && os.release().startsWith('10'));
}
function createMainWindow(config, options) {
const defaultWindowWidth = 1000;
const defaultWindowHeight = 700;
@@ -51,7 +56,7 @@ function createMainWindow(config, options) {
show: hideOnStartup || false,
minWidth: minimumWindowWidth,
minHeight: minimumWindowHeight,
frame: false,
frame: !isFramelessWindow(),
fullscreen: false,
titleBarStyle: 'hiddenInset',
backgroundColor: '#fff', // prevents blurry text: https://electronjs.org/docs/faq#the-font-looks-blurry-what-is-this-and-what-can-i-do
@@ -65,6 +70,7 @@ function createMainWindow(config, options) {
const mainWindow = new BrowserWindow(windowOptions);
mainWindow.deeplinkingUrl = options.deeplinkingUrl;
mainWindow.setMenuBarVisibility(false);
const indexURL = global.isDev ? 'http://localhost:8080/browser/index.html' : `file://${app.getAppPath()}/browser/index.html`;
mainWindow.loadURL(indexURL);