Skip to content

Commit

Permalink
fix(Windows): temporary fix to Windows 7 style frame on app startup, c…
Browse files Browse the repository at this point in the history
…loses #169
  • Loading branch information
Fabio286 committed Jan 27, 2022
1 parent 0cfd793 commit 1356011
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"core",
"MySQL",
"PostgreSQL",
"SQLite"
"SQLite",
"Windows"
],
"svg.preview.background": "transparent"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 7 additions & 7 deletions src/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -81,13 +85,6 @@ async function createMainWindow () {
mainWindow = null;
});

window.webContents.on('devtools-opened', () => {
window.focus();
setImmediate(() => {
window.focus();
});
});

return window;
}

Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 1356011

Please sign in to comment.