-
Notifications
You must be signed in to change notification settings - Fork 16.2k
fix: draggable regions calculation in BrowserWindow/BrowserView #26690
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b421141
to
1956221
Compare
zcbenz
approved these changes
Nov 30, 2020
1956221
to
1266198
Compare
1266198
to
5e00bab
Compare
ckerr
approved these changes
Dec 1, 2020
Release Notes Persisted
|
This was referenced Dec 1, 2020
I have automatically backported this PR to "10-x-y", please check out #26753 |
I have automatically backported this PR to "11-x-y", please check out #26754 |
I have automatically backported this PR to "12-x-y", please check out #26755 |
3 tasks
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Closes #26588.
Fixes a regression introduced in #26145. As a part of that PR, I reworked the parameters to
UpdateDraggableRegions
inNativeBrowserView
such that they tookconst std::vector<mojom::DraggableRegionPtr>& regions
instead ofconst std::vector<gfx::Rect>& drag_exclude_rects
. This was necessary in order to enable draggable regions worked on BrowserViews standalone, but introduced a new issue.This was that when
drag_exclude_rects
were calculated from the passed regions, they would be calculated with thewebViewWidth
andwebViewHeight
relative to the containing WebContents. This caused #26588. To fix this, we need to ensure that the excluded rects are calculated relative to theBrowserWindow
'sWebContents
when it is theBrowserWindow
which contains the draggable regions. This is done by adding a newUpdateDraggableRegions
function overload and refactoring accordingly.We also need to ensure that when the containing
BrowserWindow
is resized, and there are no draggable regions set on saidBrowserWindow
, that theBrowserViews
resize themselves accordingly. This is done by exposing an accessor todraggable_regions
of a givenNativeBrowserView
and triggering a recalculation.Tested with https://gist.github.com/ckerr/9261213d7edaadc590f8400c79ab9118 to ensure the bug was fixed, as well as https://gist.github.com/codebytere/2c072f42d7abaf27e73961b1dde87811 to ensure that this fix does not regress previous fixes.
Checklist
npm test
passesRelease Notes
Notes: Fixed an issue where draggable regions in BrowserWindow causes BrowserView to become draggable in non-correspondent places.