Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: BrowserWindow.setFullScreen shows window, despite options = { show: false } #42165

Open
3 tasks done
safris opened this issue May 14, 2024 · 0 comments
Open
3 tasks done

Comments

@safris
Copy link

safris commented May 14, 2024

Preflight Checklist

Electron Version

30.0.4

What operating system are you using?

macOS

Operating System Version

Sonoma 14.4.1

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

No response

Expected Behavior

Consider the following code:

const { app, BrowserWindow } = require("electron");

app.whenReady().then(() => {
  const win1 = new BrowserWindow({ x: 100, y: 100, show: false });
  win1.webContents.loadURL("https://developer.mozilla.org/en-US/docs/Web/API/History").then(() => {
    setTimeout(() => win1.show(), 5000);
  });

  win1.setFullScreen(true);
});

This code instantiates a BrowserWindow with { show: false }. Five seconds after it loads the given URL, BrowserWindow.show() is called to show the window.

Also, immediately after instantiation of the BrowserWindow, BrowserWindow.setFullScreen(true) is called.

Actual Behavior

The result is that the window is shown immediately when BrowserWindow.setFullScreen(true) is called.

I'm not sure what the expected behavior should be, because BrowserWindow.setFullScreen(true) may not make sense on a BrowserWindow that is now showing. Therefore, having BrowserWindow.setFullScreen(true) have the additional functionality to also show a BrowserWindow may be correct.

This is not reflected in the documentation, which begs the question if this functionality is intentional or accidental.

Here is a comment from an old issue touching on this functionality.

Testcase Gist URL

No response

Additional Information

No response

@clavin clavin changed the title [Bug]: BrowserWindow.setFullScreen(true) shows window, despite options = { show: false } [Feature Request]: BrowserWindow.setFullScreen shows window, despite options = { show: false } May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants