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

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

Closed
3 tasks done
dsanders11 opened this issue Feb 23, 2022 · 6 comments · Fixed by #33109
Closed
3 tasks done

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

dsanders11 opened this issue Feb 23, 2022 · 6 comments · Fixed by #33109
Labels
bug 🪲 component/BrowserWindow has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/windows

Comments

@dsanders11
Copy link
Member

dsanders11 commented Feb 23, 2022

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.

@codebytere
Copy link
Member

@dsanders11 did you test this on 18/17?

@codebytere codebytere added component/BrowserWindow has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/windows labels Feb 23, 2022
@dsanders11
Copy link
Member Author

@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.

@dsanders11
Copy link
Member Author

dsanders11 commented Feb 23, 2022

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

@dsanders11
Copy link
Member Author

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.

RaisinTen added a commit to RaisinTen/electron that referenced this issue Mar 1, 2022
RaisinTen added a commit to RaisinTen/electron that referenced this issue Mar 1, 2022
@RaisinTen
Copy link
Member

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

RaisinTen added a commit to RaisinTen/electron that referenced this issue Mar 1, 2022
RaisinTen added a commit to RaisinTen/electron that referenced this issue Mar 1, 2022
@dsanders11 dsanders11 changed the title [Bug]: Adding/Removing Display Changes Window Bounds [Bug]: Adding/Removing Display Changes Window Size Mar 1, 2022
@dsanders11
Copy link
Member Author

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.

ckerr added a commit that referenced this issue Mar 11, 2022
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: #33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>
trop bot pushed a commit that referenced this issue Mar 11, 2022
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: #33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>
trop bot pushed a commit that referenced this issue Mar 11, 2022
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: #33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>
trop bot pushed a commit that referenced this issue Mar 11, 2022
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: #33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>
trop bot pushed a commit that referenced this issue Mar 11, 2022
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: #33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>
trop bot pushed a commit that referenced this issue Mar 11, 2022
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: #33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>
jkleinsc pushed a commit that referenced this issue Mar 16, 2022
* chore: cherry-pick 2ed58f4 from chromium (#33109)

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: #33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update patches

Co-authored-by: Darshan Sen <raisinten@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
jkleinsc pushed a commit that referenced this issue Mar 16, 2022
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: #33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>
jkleinsc pushed a commit that referenced this issue Mar 16, 2022
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: #33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: Darshan Sen <raisinten@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
zcbenz pushed a commit that referenced this issue Mar 21, 2022
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: #33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: Darshan Sen <raisinten@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
zcbenz added a commit that referenced this issue Mar 21, 2022
* chore: cherry-pick 2ed58f4 from chromium (#33109)

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: #33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update patches

Co-authored-by: Darshan Sen <raisinten@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
zcbenz pushed a commit that referenced this issue Mar 21, 2022
* chore: cherry-pick 2ed58f4 from chromium (#33109)

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: #33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* Trigger Build

* chore: update patches

Co-authored-by: Darshan Sen <raisinten@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
bavulapati pushed a commit to bavulapati/electron that referenced this issue Apr 29, 2022
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: electron#33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>
khalwa pushed a commit to solarwindscloud/electron that referenced this issue Feb 22, 2023
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3492658
Fixes: electron#33049
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 component/BrowserWindow has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants