fix: fullscreen for windows without rounded corners (#47682)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2025-07-08 15:22:52 +02:00 committed by GitHub
commit 6e9a46042d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 67 additions and 10 deletions

View file

@ -5993,6 +5993,54 @@ describe('BrowserWindow module', () => {
await leaveFullScreen;
});
it('should not crash if rounded corners are disabled', async () => {
const w = new BrowserWindow({
frame: false,
roundedCorners: false
});
const enterFullScreen = once(w, 'enter-full-screen');
w.setFullScreen(true);
await enterFullScreen;
await setTimeout();
const leaveFullScreen = once(w, 'leave-full-screen');
w.setFullScreen(false);
await leaveFullScreen;
});
it('should not crash if opening a borderless child window from fullscreen parent', async () => {
const parent = new BrowserWindow();
const parentFS = once(parent, 'enter-full-screen');
parent.setFullScreen(true);
await parentFS;
await setTimeout();
const child = new BrowserWindow({
width: 400,
height: 300,
show: false,
parent,
frame: false,
roundedCorners: false
});
await setTimeout();
const childFS = once(child, 'enter-full-screen');
child.show();
await childFS;
await setTimeout();
const leaveFullScreen = once(child, 'leave-full-screen');
child.setFullScreen(false);
await leaveFullScreen;
});
it('should be able to load a URL while transitioning to fullscreen', async () => {
const w = new BrowserWindow({ fullscreen: true });
w.loadFile(path.join(fixtures, 'pages', 'c.html'));