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]: setBounds calls during will-resize are no longer applied when preventing the default resize #34599

Closed
3 tasks done
meredith-ciq opened this issue Jun 16, 2022 · 0 comments · Fixed by #34843
Closed
3 tasks done
Labels
17-x-y 18-x-y 19-x-y bug 🪲 bug/regression ↩️ A new version of Electron broke something has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/windows

Comments

@meredith-ciq
Copy link

Preflight Checklist

Electron Version

17.4, 18, 19

What operating system are you using?

Windows

Operating System Version

Windows 10 Pro 21H1

What arch are you using?

x64

Last Known Working Electron version

17.3.1

Expected Behavior

Prior to version 17.4.0, it was possible to override the bounds received within will-resize event. While this ability is not explicitly documented, we rely on it for window management within our product.

Actual Behavior

The window no longer resizes when the will-resize event is prevented and we attempt to control the resize with setBounds.

Testcase Gist URL

https://gist.github.com/meredith-ciq/a7ad120e84bd028a3fbd26b8f61aa45c

Additional Information

This was caused during the changes from:
#33288
I believe the gate on is_resizing_ at the top of setBounds is preventing any ability to overwrite the bounds that come in during a will-resize event.

Our application currently overrides the native resize and does our own resize after modifying the window bounds. This has caused resize to break in recent electron versions as the intermediate setBounds calls during resize are not being applied. We have several aspects of window management that depend on having this level of control over resize:

  • Groups of windows maintaining proportions when a single window in the group is resized
  • Snapping edges of windows to other windows during resize
  • Resolving jitter of a window during resize by applying our own calculations

I've also mentioned this issue in a related issue: #33897. The fix from that issue only had the effect of not applying the final setBounds in the resize action. In our case that causes the window to no longer resize instead of giving no visual indication that a resize was occurring until the corner or edge of the window was dropped. I did some testing with the gist in that issue on the latest electron and it appears the behavior only works when some of the native resize events are allowed through.

@mlaurencin mlaurencin added platform/windows has-repro-gist Issue can be reproduced with code at https://gist.github.com/ 17-x-y 18-x-y 19-x-y labels Jun 29, 2022
@VerteDinde VerteDinde added the bug/regression ↩️ A new version of Electron broke something label Jun 29, 2022
mesner added a commit to mesner/electron that referenced this issue Jul 7, 2022
zcbenz pushed a commit that referenced this issue Jul 27, 2022
…fault (#34843)

fix: #34599 allow setsize to be called within a move or resize for preventDefault
trop bot pushed a commit that referenced this issue Jul 27, 2022
trop bot pushed a commit that referenced this issue Jul 27, 2022
trop bot pushed a commit that referenced this issue Jul 27, 2022
codebytere pushed a commit that referenced this issue Jul 27, 2022
…fault (#35084)

fix: #34599 allow setsize to be called within a move or resize for preventDefault

Co-authored-by: Ian German Mesner <mesner@gmail.com>
codebytere pushed a commit that referenced this issue Jul 27, 2022
…fault (#35083)

fix: #34599 allow setsize to be called within a move or resize for preventDefault

Co-authored-by: Ian German Mesner <mesner@gmail.com>
codebytere pushed a commit that referenced this issue Aug 3, 2022
…fault (#35082)

fix: #34599 allow setsize to be called within a move or resize for preventDefault

Co-authored-by: Ian German Mesner <mesner@gmail.com>
schetle pushed a commit to schetle/electron that referenced this issue Nov 3, 2022
…fault (electron#34843)

fix: electron#34599 allow setsize to be called within a move or resize for preventDefault
khalwa pushed a commit to solarwindscloud/electron that referenced this issue Feb 22, 2023
…fault (electron#34843)

fix: electron#34599 allow setsize to be called within a move or resize for preventDefault
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
17-x-y 18-x-y 19-x-y bug 🪲 bug/regression ↩️ A new version of Electron broke something has-repro-gist Issue can be reproduced with code at https://gist.github.com/ platform/windows
Projects
No open projects
Status: Fixed for Next Release
Development

Successfully merging a pull request may close this issue.

3 participants