Description
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 a bug report that matches the one I want to file, without success.
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 o 70CB verrides 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.