electron: [Bug]: Wrong initial window size, when using multiple monitors with different resolution and scaling

Preflight Checklist

Electron Version

15.0.0

What operating system are you using?

Windows

Operating System Version

Windows 10 Enterprise 20H2

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

The initial effectiv window size is correct in various screen and scaling combinations.

Actual Behavior

My setup: Two screens with different resolutions (external + laptop) side by side. The main monitor is the laptop screen. With 150% OS scaling. Secondary monitor is the external screen. With 100% OS scaling. The secondary (external) monitor is arranged on the left side of the primary monitor (laptop).

Open an new BrowserWindow on the secondary screen with new BrowserWindow({ show: true, width: 1500, height: 750, x: -1500, y: 150 }); results in a effective width of 987 and the effective height of 494. Thats wrong.

Open an new BrowserWindow on the primary screen with new BrowserWindow({ show: true, width: 1500, height: 750, x: -1500, y: 150 }); results in a effective width of 2233 and the effective height of 1118. Thats ok, because the main screen is scalled (150%).

Using 100% OS scaling on both screens both new BrowserWindows calls will have width of 1468 and height of 743. Thats also ok.

Testcase Gist URL

No response

Additional Information

No response

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 28 (5 by maintainers)

Commits related to this issue

Most upvoted comments

This has been an issue in my project as well.

Is electron being maintained? Usually, if a non-trivial bug like this persists for multiple years without getting addressed, it’s not a great sign.

This has become an issue for my wife on her Signal, and is most likely an issue for many people that

a) are not on GitHub, nor search for answers here. and b) simply just leave an app if it doesn’t “work” as expected, instead of trying to trouble-shoot.

It’s been an issue for almost three years now.

Still happening.

Still happening.On Jul 2, 2024, at 3:52 AM, electron-issue-triage[bot] @.***> wrote: This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, “bump”), and we’ll keep it open. If you have any new additional informat

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, “bump”), and we’ll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

Still an issue.

See #10862 which may explain the root cause of this issue. I just added information with my investigation into this type of issue,

I can confirm that this is still an issue with Electron 25.