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: handle closing webContents
in BrowserView
s
#37420
Conversation
2348cb8
to
91e2353
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.
any chance we could get a test? esp, window.close()
from the web content not actually closing the BrowserView seems like something we could have a regression test for!
91e2353
to
19865e3
Compare
19865e3
to
c915e50
Compare
Release Notes Persisted
|
I was unable to backport this PR to "22-x-y" cleanly; |
I have automatically backported this PR to "24-x-y", please check out #37450 |
I have automatically backported this PR to "23-x-y", please check out #37451 |
When can this be backported to v22? |
As #37205 says, the crash is caused by the NativeWindow::NonClientHitTest call. the bug in "NativeWindow::NonClientHitTest" is introduced in #36230. However, the branch of 22-x-y does not contain this refactor. So, just revert it(#37205) in 22-x-y |
Description of Change
Closes #37356.
Closes #37419.
Closes #37378.
Refs #37205.
Take 2.
The combination of #35509 and #35603 meant that if a user called
webContents.destroy()
on aBrowserView
'swebContents
, the associatedDraggableRegionProvider
would not be removed from theNativeWindow
, as the only codepath for doing so relied on the user removing the entireBrowserView
viaBrowserWindow.removeBrowserView
. The first approach I tried fixed a symptom, but then prevented thedestroyed
event from emitting if aBrowserView
still existed.This PR undoes that change in favor of this better change, which ensures the
DraggableRegionProvider
isn't left around for a ghostBrowserView
webContents
.Tested with:
Checklist
npm test
passesRelease Notes
Notes: Fixed
destroyed
event not emitted onclose
forBrowserView.webContents
.