electron: [Bug]: Can't Create BrowserWindow Larger Than Screen Width

Preflight Checklist

Electron Version

17.0.0

What operating system are you using?

Windows

Operating System Version

Windows 10

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

Creating a BrowserWindow with width larger than the screen creates a window with the requested width.

Actual Behavior

Creating a BrowserWindow with width larger than the screen creates a window where the width is clipped to the screen width.

Testcase Gist URL

https://gist.github.com/dsanders11/dbeb5222566ebe7f01dc72b93884202f

Additional Information

Setting the width to larger than the screen width after creating the window, using BrowserWindow.setSize, does work. It should either also work from the BrowserWindow constructor, or the documentation should mention that it doesn’t.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

I think from user’s perspective, enableLargerThanScreen: true should be a clear sign that they want to be able to set the window to arbitrary size. So with enableLargerThanScreen: true, setting size in constructor and calling setSize should both be able to set window size larger than screen.