When we create the main window of the app using saved bounds from the disk, if the screen that we are putting the window is scaled to a higher value than 100%, the window will try to render outside the boundaries of the screen in a multi-monitor environment.
This is due to a bug in Electron (https://github.com/electron/electron/issues/10862) where the setBounds() function of the BrowserWindow seems to ignore scale factor altogether. This PR contains a workaround that will manually resize the saved bounds using the scale factor of the target monitor to put the window back correctly, avoiding any multi-monitor overlap.
Summary
When we create the main window of the app using saved bounds from the disk, if the screen that we are putting the window is scaled to a higher value than 100%, the window will try to render outside the boundaries of the screen in a multi-monitor environment.
This is due to a bug in Electron (https://github.com/electron/electron/issues/10862) where the
setBounds()
function of theBrowserWindow
seems to ignore scale factor altogether. This PR contains a workaround that will manually resize the saved bounds using the scale factor of the target monitor to put the window back correctly, avoiding any multi-monitor overlap.Ticket Link
https://mattermost.atlassian.net/browse/MM-58357 Closes https://github.com/mattermost/desktop/issues/3039