Skip to content

[Bug]: Adding/Removing Display Changes Window Size #33049

Closed

Description

@dsanders11

Preflight Checklist

Electron Version

19.0.0-nightly.20220207

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

Adding or removing a display will not change the size of a BrowserWindow.

Actual Behavior

Adding or removing a display does change the size of a BrowserWindow.

Testcase Gist URL

https://gist.github.com/7f8c673311b123fa4f7fe3444b4d0fea

Additional Information

Gist of course will only work if you have a second monitor to test with - it uses the 'display-added' event.

On Windows the width and height of a window shrinks by 1 pixel every time a display is added or removed. Other platforms are not affected.

Activity

  1. codebytere commented on Feb 23, 2022

    @codebytere
    Member

    @dsanders11 did you test this on 18/17?

  2. added
    has-repro-gist
    on Feb 23, 2022
  3. dsanders11 commented on Feb 23, 2022

    @dsanders11
    MemberAuthor

    @codebytere, just did, reproduces there as well. I can see it actually affecting Fiddle itself as well, which is on v15, so I'd say all supported versions are affected.

  4. dsanders11 commented on Feb 23, 2022

    @dsanders11
    MemberAuthor

    In fact it appears to be an upstream Chromium issue, I can see the Chrome window also shrinking by a pixel as I add and remove the display.

    EDIT: Upstream issue filed: https://bugs.chromium.org/p/chromium/issues/detail?id=1300415

  5. dsanders11 commented on Feb 24, 2022

    @dsanders11
    MemberAuthor

    I've tested on Ubuntu and it does not reproduce there, so looking like a Windows only issue. The test fiddle fails on Ubuntu, but only because of the x,y coordinates (there's a sidebar on the left in Ubuntu), but width and height don't change.

  6. RaisinTen commented on Mar 1, 2022

    @RaisinTen
    Contributor

    Sent a PR to cherry-pick the upstream fix: #33109

  7. changed the title [-][Bug]: Adding/Removing Display Changes Window Bounds[/-] [+][Bug]: Adding/Removing Display Changes Window Size[/+] on Mar 1, 2022
  8. dsanders11 commented on Mar 1, 2022

    @dsanders11
    MemberAuthor

    I've updated this issue to narrow the scope to just the changing window size bug, which was fixed upstream and @RaisinTen has cherry-picked. I may open a new issue regarding the position change, after I check behavior of that on more platforms.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲component/BrowserWindowhas-repro-gistplatform/windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions