SDA-3784 Window resizing optim

This commit is contained in:
sbenmoussati 2022-07-26 17:22:51 +02:00 committed by Salah Benmoussati
parent bc449c3fe7
commit 4530c2aca9

View File

@ -1365,31 +1365,8 @@ export const loadBrowserViews = async (
y: TITLE_BAR_HEIGHT,
});
mainView.setAutoResize({
horizontal: true,
vertical: false,
width: true,
height: false,
});
// Workaround to fix the auto resize of the main view container height
mainWindow.on('resize', () => {
if (
!mainView ||
mainView.webContents.isDestroyed() ||
!mainWindow ||
!windowExists(mainWindow)
) {
return;
}
const bounds = mainView.getBounds();
const [, height] = mainWindow.getSize();
mainView.setBounds({
...bounds,
...{
y: mainWindow.isFullScreen() ? 0 : TITLE_BAR_HEIGHT,
height: mainWindow.isFullScreen() ? height : height - TITLE_BAR_HEIGHT,
},
});
height: true,
});
windowHandler.setMainView(mainView);