diff --git a/src/backend/main.ts b/src/backend/main.ts index 32141b8fbb..c79e2ebd04 100644 --- a/src/backend/main.ts +++ b/src/backend/main.ts @@ -268,6 +268,21 @@ async function initializeWindow(): Promise { mainWindow.webContents.setVisualZoomLevelLimits(1, 1) }) + function applyZoom() { + const zoomFactor = processZoomForScreen( + configStore.get('zoomPercent', 100) / 100 + ) + mainWindow.webContents.setZoomLevel(zoomFactor) + mainWindow.webContents.setVisualZoomLevelLimits(1, 1) + } + + mainWindow.on('maximize', applyZoom) + mainWindow.on('unmaximize', applyZoom) + mainWindow.on('restore', applyZoom) + mainWindow.on('enter-full-screen', applyZoom) + mainWindow.on('leave-full-screen', applyZoom) + mainWindow.webContents.on('did-navigate', applyZoom) + return mainWindow }