[MM-33577] Workaround for Linux minimizing/maximizing issue (#1527)

This commit is contained in:
Devin Binnie
2021-04-06 18:47:02 -04:00
committed by GitHub
parent 8d383b3de2
commit dd41c3a14d

View File

@@ -120,10 +120,26 @@ function handleMainWindowWebContentsCrashed() {
function handleMaximizeMainWindow() {
sendToRenderer(MAXIMIZE_CHANGE, true);
// Workaround as part of https://mattermost.atlassian.net/browse/MM-33577
// Linux (or GNOME at least) seems to have issues with Electron and getting the size correctly when minimizing/maximizing
// So we need to manually force the browser view to resize after a small interval to get the size correct
// Please remove this once this issue has been resolved by Electron
if (process.platform === 'linux') {
setTimeout(setBoundsForCurrentView, 10);
}
}
function handleUnmaximizeMainWindow() {
sendToRenderer(MAXIMIZE_CHANGE, false);
// Workaround as part of https://mattermost.atlassian.net/browse/MM-33577
// Linux (or GNOME at least) seems to have issues with Electron and getting the size correctly when minimizing/maximizing
// So we need to manually force the browser view to resize after a small interval to get the size correct
// Please remove this once this issue has been resolved by Electron
if (process.platform === 'linux') {
setTimeout(setBoundsForCurrentView, 10);
}
}
function handleResizeMainWindow(event, newBounds) {