fix(electron): screen resize sometimes does not work well after maximize (#8413)

fix AF-1460
This commit is contained in:
pengx17
2024-10-07 11:21:57 +00:00
parent 6b263d1441
commit f5c49a6ac9
@@ -693,7 +693,13 @@ export class WebContentViewsManager {
} }
}; };
screenSizeChangeEvents.forEach(event => { screenSizeChangeEvents.forEach(event => {
w.on(event as any, onResize); w.on(event as any, () => {
onResize();
// sometimes the resize event is too fast, the view is not ready for the new size (esp. on linux)
setTimeout(() => {
onResize();
}, 100);
});
}); });
// add shell view // add shell view