fix(Windows): temporary fix to Windows 7 style frame on app startup, closes #169

This commit is contained in:
Fabio Di Stasio 2022-01-27 23:40:03 +01:00
parent 0cfd7938ee
commit 1356011ba3
3 changed files with 10 additions and 9 deletions

View File

@ -4,7 +4,8 @@
"core",
"MySQL",
"PostgreSQL",
"SQLite"
"SQLite",
"Windows"
],
"svg.preview.background": "transparent"
}

View File

@ -137,7 +137,7 @@
"clean-webpack-plugin": "^4.0.0",
"cross-env": "^7.0.2",
"css-loader": "^6.5.0",
"electron": "^16.0.7",
"electron": "^16.0.8",
"electron-builder": "^22.14.11",
"electron-devtools-installer": "^3.2.0",
"eslint": "^7.32.0",

View File

@ -13,6 +13,7 @@ Store.initRenderer();
const isDevelopment = process.env.NODE_ENV !== 'production';
const isMacOS = process.platform === 'darwin';
const isWindows = process.platform === 'win32';
const gotTheLock = app.requestSingleInstanceLock();
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = 'true';
@ -45,6 +46,9 @@ async function createMainWindow () {
backgroundColor: '#1d1d1d'
});
if (isWindows) // Temporary workaround to https://github.com/electron/electron/issues/30024
window.minimize();
mainWindowState.manage(window);
window.on('moved', saveWindowState);
@ -81,13 +85,6 @@ async function createMainWindow () {
mainWindow = null;
});
window.webContents.on('devtools-opened', () => {
window.focus();
setImmediate(() => {
window.focus();
});
});
return window;
}
@ -120,6 +117,9 @@ else {
mainWindow = await createMainWindow();
createAppMenu();
if (isWindows) // Temporary workaround to https://github.com/electron/electron/issues/30024
mainWindow.focus();
// if (isDevelopment)
// mainWindow.webContents.openDevTools();