Override cached window's zoomFactor

Change-type: patch
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzothunder.ambrosi@gmail.com>
This commit is contained in:
Lorenzo Alberto Maria Ambrosi 2020-08-27 10:26:21 +02:00
parent aa72c5d3bb
commit 42838eba09

View File

@ -161,6 +161,9 @@ async function createMainWindow() {
// Prevent flash of white when starting the application
mainWindow.on('ready-to-show', () => {
console.timeEnd('ready-to-show');
// Electron sometimes caches the zoomFactor
// making it obnoxious to switch back-and-forth
mainWindow.webContents.setZoomFactor(width / defaultWidth);
mainWindow.show();
});