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: resizing borders in nondraggable regions #37016

Merged
merged 2 commits into from
Jan 26, 2023
Merged

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Jan 25, 2023

Description of Change

Closes #37008.
Refs #36230.

The above refactor improved draggable regions by typing them most closely to WebContents, but introduced an issue whereby draggable regions could take precedence over resizing borders on Windows. This was happening as a result of NativeWindow::NonClientHitTest, which returned the first non-HTNOWHERE value it found. This meant that the window's border coordinates would not take appropriate precedence, and instead of HTBOTTOM, HTLEFT, etc being returned for the window edge coordinates, HTCAPTION would instead be returned and the window bordered rendered useless. We fix this by first checking ResizingBorderHitTest results in NativeWindow::NonClientHitTest and proceeding to draggable region calculations if we are not on a resizing window border.

Tested with https://gist.github.com/takumus/9054bde77c8206143232fed2659bf108

Checklist

Release Notes

Notes: Fixes an issue where some frameless windows with draggable regions were not resizable on Windows.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/23-x-y PR should also be added to the "23-x-y" branch. labels Jan 25, 2023
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jan 25, 2023
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jan 26, 2023
@codebytere codebytere merged commit 0026fdb into main Jan 26, 2023
@codebytere codebytere deleted the fix-resizing-borders-win branch January 26, 2023 13:04
@release-clerk
Copy link

release-clerk bot commented Jan 26, 2023

Release Notes Persisted

Fixes an issue where some frameless windows with draggable regions were not resizable on Windows.

@trop
Copy link
Contributor

trop bot commented Jan 26, 2023

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

@trop trop bot added in-flight/23-x-y merged/23-x-y PR was merged to the "23-x-y" branch. and removed target/23-x-y PR should also be added to the "23-x-y" branch. in-flight/23-x-y labels Jan 26, 2023
MarshallOfSound added a commit that referenced this pull request Feb 21, 2023
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
* fix: resizing borders in nondraggable regions

* chore: remove frame handling from ShouldDescendIntoChildForEventHandling
gecko19 pushed a commit to brightsign/electron that referenced this pull request Feb 28, 2023
* fix: resizing borders in nondraggable regions

* chore: remove frame handling from ShouldDescendIntoChildForEventHandling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/23-x-y PR was merged to the "23-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Unable to resize, with cursor drag, from edge of window that is set to -webkit-app-region:drag
2 participants