[MM-48574] Fixed issue on windows where in some cases window resize does not work (#2441)
* Fixed issue on windows where in some cases window resize does not work * Use silly instead of debug for window resizing functions
This commit is contained in:
@@ -131,7 +131,7 @@ export class ModalManager {
|
||||
}
|
||||
|
||||
handleResizeModal = (event: IpcMainEvent, bounds: Electron.Rectangle) => {
|
||||
log.debug('ModalManager.handleResizeModal', bounds);
|
||||
log.debug('ModalManager.handleResizeModal', {bounds, modalQueueLength: this.modalQueue.length});
|
||||
|
||||
if (this.modalQueue.length) {
|
||||
const currentModal = this.modalQueue[0];
|
||||
|
@@ -264,8 +264,17 @@ export class WindowManager {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fixes an issue on win11 related to Snap where the first "will-resize" event would return the same bounds
|
||||
* causing the "resize" event to not fire
|
||||
*/
|
||||
const prevBounds = this.getBounds();
|
||||
if (prevBounds.height === newBounds.height && prevBounds.width === newBounds.width) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isResizing && this.viewManager.loadingScreenState === LoadingScreenState.HIDDEN && this.viewManager.getCurrentView()) {
|
||||
log.silly('prevented resize');
|
||||
log.debug('prevented resize');
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
@@ -297,6 +306,8 @@ export class WindowManager {
|
||||
}
|
||||
|
||||
private throttledWillResize = (newBounds: Electron.Rectangle) => {
|
||||
log.silly('WindowManager.throttledWillResize', {newBounds});
|
||||
|
||||
this.isResizing = true;
|
||||
this.setCurrentViewBounds(newBounds);
|
||||
}
|
||||
@@ -324,6 +335,8 @@ export class WindowManager {
|
||||
};
|
||||
|
||||
setCurrentViewBounds = (bounds: {width: number; height: number}) => {
|
||||
log.debug('WindowManager.setCurrentViewBounds', {bounds});
|
||||
|
||||
const currentView = this.viewManager?.getCurrentView();
|
||||
if (currentView) {
|
||||
const adjustedBounds = getAdjustedWindowBoundaries(bounds.width, bounds.height, shouldHaveBackBar(currentView.tab.url, currentView.view.webContents.getURL()));
|
||||
|
Reference in New Issue
Block a user