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: move NativeWindow tracking to OSR WCV #15585
Conversation
6fe7dc6
to
31812ec
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.
We could try to make this a bit less cast-y by moving the native window tracking to OffScreenWebContentsView
, that is explicitly created when the api::WebContents
is created, so that should already exist when SetOwnerWindow
is called.
31812ec
to
83f9478
Compare
@brenca Thanks! I updated the branch with your patch. |
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.
lgtm, but would like a second opinion, @codebytere maybe?
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.
Approve to get groups checked, but still waiting on @ckerr @codebytere
@zcbenz this needs your approval for the two missing codeowner teams when you have a moment :) |
Release Notes Persisted
|
/trop run backport-to 4-0-x |
The backport process for this PR has been manually initiated, |
I was unable to backport this PR to "4-0-x" cleanly; |
* fix: move NativeWindow tracking to OSR WCV * fix oops
Description of Change
In #15046, when we re-enabled OSR for 4.0.x, it seems passing in a
NativeWindow
to the constructor ofOffScreenRenderWidgetHostView
became optional with the intent thatSetOwnerWindow
would call intoSetNativeWindow
-- in my experience this just isn't happening.When
SetOwnerWindow
is called initially (at https://github.com/electron/electron/blob/master/atom/browser/api/atom_api_browser_window.cc#L78)content::WebContents::GetRenderWidgetHostView
returnsnullptr
(it hasn't been created yet) and it was never called again.I haven't dug in too deep with regards to the root causes but missing out on initialization with a
NativeWindow
caused my OSR window to never paint (without debugger shenanigans.) This PR restores the behavior of constructing theOffScreenRenderWidgetHostView
with a validNativeWindow
.I have no idea if this is the "right" solution, so I'm certainly open for alternate solutions, but I figured I'd open the discussion with a PR that "works for me."
NB: I tried using the
NativeWindowRelay
like is used elsewhere inOffScreenWebContentsView
but it, of course, has no entry untilSetOwnerWindow
is called.Checklist
npm test
passesRelease Notes
Notes: fix: move NativeWindow tracking to OSR WCV