8000 [Bug]: setBounds calls during will-resize are no longer applied when preventing the default resize · Issue #34599 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[Bug]: setBounds calls during will-resize are no longer applied when preventing the default resize #34599
Closed
@meredith-ciq

Description

@meredith-ciq

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0