Preflight Checklist
Electron Version
20.0.1
What operating system are you using?
Windows
Operating System Version
Windows 11
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
No visual glitch, the whole window showing the background color (default or set using backgroundColor) until the content is loaded.
Actual Behavior
On Windows using the maximize method of BrowserWindow after opening the app's window causes a visual glitch until it loads the content.
This results in a bad user experience.
Tested on Windows 10 & 11 64-bit.
Also tested on Ubuntu 22.04 64-bit, it's good, no visual glitch.
Tried with default window width and height.
Method:
https://www.electronjs.org/docs/latest/api/browser-window#winmaximize
Code:
const win = new BrowserWindow();
win.maximize();
Workaround:
Don't show the window, maximize it, then show it:
const win = new BrowserWindow({show: false});
win.maximize();
win.show();
Or hide the window, then maximize it, then show it:
const win = new BrowserWindow();
win.hide();
win.maximize();
win.show();
Test:
https://github.com/Adam777Z/electron-windows-visual-glitch-test
Testcase Gist URL
No response
Additional Information
No response
Preflight Checklist
Electron Version
20.0.1
What operating system are you using?
Windows
Operating System Version
Windows 11
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
No visual glitch, the whole window showing the background color (default or set using backgroundColor) until the content is loaded.
Actual Behavior
On Windows using the maximize method of BrowserWindow after opening the app's window causes a visual glitch until it loads the content.
This results in a bad user experience.
Tested on Windows 10 & 11 64-bit.
Also tested on Ubuntu 22.04 64-bit, it's good, no visual glitch.
Tried with default window width and height.
Method:
https://www.electronjs.org/docs/latest/api/browser-window#winmaximize
Code:
Workaround:
Don't show the window, maximize it, then show it:
Or hide the window, then maximize it, then show it:
Test:
https://github.com/Adam777Z/electron-windows-visual-glitch-test
Testcase Gist URL
No response
Additional Information
No response