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: webContents interaction with draggable BrowserViews #26496
Conversation
e41032a
to
0909058
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did some testing and could not find any problem with this approach.
Release Notes Persisted
|
I was unable to backport this PR to "10-x-y" cleanly; |
I was unable to backport this PR to "9-x-y" cleanly; |
I have automatically backported this PR to "11-x-y", please check out #26528 |
@codebytere has manually backported this PR to "9-x-y", please check out #26745 |
@codebytere has manually backported this PR to "10-x-y", please check out #26744 |
Description of Change
Closes #26355.
Fixed an issue where some buttons were un-clickable in some BrowserViews with draggable regions enabled.
This was happening because the way we construct draggable regions in
BrowserViews
is different than what we do inBrowserWindows
- we implement them in the former by creating a new draggableNSView
and overlaying regions that are not draggable. To accomplish this, we need tohitTest
the view, so we can perform the correct actions when a user mouses down and tries to drag. Chromium explicitly chooses to ignore mouse events inRenderWidgetHostViewCocoa
when another view has returned itself in thehitTest
, which is the case here and the root of the bug.To fix the issue resultant of the above, we explicitly need to tell Chromium that it should not use its own mouse ignore logic if a
NSEventTypeLeftMouseDragged
orNSEventTypeLeftMouseDown
event - it should first check to see if we've told it not to do that and then proceed accordingly.Tested with https://gist.github.com/060ad478da5b628726da4b4ea94a16a6.
cc @MarshallOfSound @zcbenz
Checklist
npm test
passesRelease Notes
Notes: Fixed an issue where some buttons were un-clickable in some BrowserViews with draggable regions enabled.