mirror of
https://github.com/Fabio286/antares.git
synced 2025-01-30 17:15:08 +01:00
fix(Windows): temporary fix to Windows 7 style frame on app startup, closes #169
This commit is contained in:
parent
0cfd7938ee
commit
1356011ba3
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -4,7 +4,8 @@
|
||||
"core",
|
||||
"MySQL",
|
||||
"PostgreSQL",
|
||||
"SQLite"
|
||||
"SQLite",
|
||||
"Windows"
|
||||
],
|
||||
"svg.preview.background": "transparent"
|
||||
}
|
@ -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",
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user