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

fix: delayed bounds when moving/resizing and preventing default #34204

Merged
merged 1 commit into from May 19, 2022

Conversation

codebytere
Copy link
Member

Description of Change

Closes #33897.
Refs #33288.

Fixes an issue where bounds changes were incorrectly delayed in the case where a window was moved or resized and event.preventDefault was called in either will-resize or will-move. We can assume in this case that we should prevent the pending bounds if the user is overridding functionality in either callback.

Tested with https://gist.github.com/ccc3e3fa4f724b5d717d9fc8f9c8dfe2 as well as https://gist.github.com/6b6ea5cdaa1883656a8bd0bf89195283 to ensure no regression of the initial issue.

Checklist

Release Notes

Notes: Fixed an issue where bounds changes were incorrectly delayed in the case where a window was moved or resized and event.preventDefault was called in either will-resize or will-move on Windows.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/16-x-y labels May 12, 2022
@electron-cation electron-cation bot added new-pr 🌱 PR opened in the last 24 hours and removed new-pr 🌱 PR opened in the last 24 hours labels May 12, 2022
@ckerr
Copy link
Member

ckerr commented May 13, 2022

pending_bounds_change_ is has kind of a smell to it since adding that state variable means we'll need special cases like this.

Short of a refactor that removes that special-case state field -- and it's not clear to me what we'd replace it with -- this fix looks reasonable

Copy link
Member

@ckerr ckerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving as a followup to my previous comment since the PR has been around for a few days now, but I'd prefer if someone else more familiar with this file also put in a review 🙂

@codebytere codebytere requested review from VerteDinde and removed request for zcbenz May 18, 2022 10:19
Copy link
Member

@VerteDinde VerteDinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Looks good to me, this is a small change and I think risk of regression is low 👍

@codebytere codebytere merged commit 73e0bf9 into main May 19, 2022
@codebytere codebytere deleted the fix-will-resize-pending branch May 19, 2022 08:03
@release-clerk
Copy link

release-clerk bot commented May 19, 2022

Release Notes Persisted

Fixed an issue where bounds changes were incorrectly delayed in the case where a window was moved or resized and event.preventDefault was called in either will-resize or will-move on Windows.

@trop
Copy link
Contributor

trop bot commented May 19, 2022

I have automatically backported this PR to "16-x-y", please check out #34282

@trop
Copy link
Contributor

trop bot commented May 19, 2022

I have automatically backported this PR to "17-x-y", please check out #34283

@trop
Copy link
Contributor

trop bot commented May 19, 2022

I have automatically backported this PR to "18-x-y", please check out #34284

@trop trop bot removed the target/16-x-y label May 19, 2022
@trop
Copy link
Contributor

trop bot commented May 19, 2022

I have automatically backported this PR to "19-x-y", please check out #34285

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: setSize on BrowserWindow during will-resize is applied on mouse-up and not immediately
3 participants