SDA-3422 - Workaround for the main view container height resize issue (#1289)

This commit is contained in:
Kiran Niranjan 2021-11-03 13:58:32 +05:30 committed by GitHub
parent 19178b6878
commit 54ba4598b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1179,6 +1179,27 @@ export const loadBrowserViews = async (
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,
},
});
});
windowHandler.setMainView(mainView);
windowHandler.setTitleBarView(mainView);