Skip to content

Resizable: false causes incorrect window sizes on differently scaled monitors #20683

Closed

Description

@sgd2z

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • 7.0.0 beta 4+ (including 7.0 release), 6.0.6+
  • Operating System:
    • Windows 10 (1903)
  • Last Known Working Electron version:
    • 7.0.0 beta 3, 6.0.5

Expected Behavior

Non resizable windows should have proper bounds on Monitors with display scales that are different from the primary.

Actual Behavior

Non-resizable windows have bounds that are off by the ratio of the display scale of the secondary monitor to the primary monitor. e.g. if primary monitor is 200% scaled and secondary is 100%, the windows are 200/100 = twice the width and height.

To Reproduce

Set your left monitor to primary with 200% scale
Set your right monitor to 100% scale
Then run this gist. Based on the resolution of your monitors, you might have to adjust the x position:
https://gist.github.com/sgd2z/7f92316b5fc920a59a55ee85c56011f4

Screenshot

Here is a 200 x 200 window (the Hello World! from the reproducer) next to a correctly sized 400 x 400 window.
image

Additional Information

We believe that this is caused by this PR:
#19928
based on the version boundaries of where the dimensions cease to be incorrect.

Activity

  1. carterbs commented on Oct 24, 2019

    @carterbs
    Contributor

    To anyone following this issue - if you set resizable to true right before setting the bounds on the window, the bug disappears. Workaround until it can be fixed properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions