Repository: electron/electron (language: cpp)

Issue:
[Bug]: setBounds calls during will-resize are no longer applied when preventing the default resize
### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) 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](https://github.com/electron/electron/pull/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.


Discussion / hints:

Fix patch:
diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc
index f33a3705cf031..3676d92ce9b5f 100644
--- a/shell/browser/native_window_views.cc
+++ b/shell/browser/native_window_views.cc
@@ -719,7 +719,6 @@ void NativeWindowViews::SetBounds(const gfx::Rect& bounds, bool animate) {
 #if BUILDFLAG(IS_WIN)
   if (is_moving_ || is_resizing_) {
     pending_bounds_change_ = bounds;
-    return;
   }
 #endif
 


Test patch: