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: draggable regions with devtools open #29696

Merged
merged 1 commit into from Jun 16, 2021

Conversation

codebytere
Copy link
Member

Description of Change

Closes #29159.

We addressed a similar problem in #26361 but draggable regions are implemented differently enough across platforms that one solution rarely addresses all of them. Windows and Linux work such that we check the current cursor position and then check to see if that falls inside draggable region bounds. On BrowserViews, we considered that the BrowserView bounds may not begin at (0,0) and accounted for that by offsetting the bounds when performing that calculation, but failed to take into account that this may also be the case for draggable regions inside the primary BrowserWindow's WebContents. When a DevTools instance is open, for example, this would mean the draggable region would be offset - this PR fixes the oversight by always ensuring that the cursor location logic is performed according to the relative bounds of the WebContents containing the draggable region.

Checklist

Release Notes

Notes: Fixed an issue where draggable regions sometimes did not work properly when DevTools is open.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/12-x-y labels Jun 15, 2021
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jun 15, 2021
@codebytere codebytere force-pushed the fix-devtools-draggable-resize-win branch from fae8ecc to 04e9ab4 Compare June 15, 2021 09:42
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Jun 16, 2021
@MarshallOfSound MarshallOfSound merged commit d59e2d7 into main Jun 16, 2021
@MarshallOfSound MarshallOfSound deleted the fix-devtools-draggable-resize-win branch June 16, 2021 16:58
@release-clerk
Copy link

release-clerk bot commented Jun 16, 2021

Release Notes Persisted

Fixed an issue where draggable regions sometimes did not work properly when DevTools is open.

@trop
Copy link
Contributor

trop bot commented Jun 16, 2021

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

@trop trop bot removed the target/12-x-y label Jun 16, 2021
@trop
Copy link
Contributor

trop bot commented Jun 16, 2021

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

@trop
Copy link
Contributor

trop bot commented Jun 16, 2021

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

BlackHole1 pushed a commit to BlackHole1/electron that referenced this pull request Aug 30, 2021
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]: Some of developer tools region also drag the electron app
4 participants