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: move NativeWindow tracking to OSR WCV #15585

Merged
merged 3 commits into from Nov 30, 2018

Conversation

adill
Copy link
Contributor

@adill adill commented Nov 6, 2018

Description of Change

In #15046, when we re-enabled OSR for 4.0.x, it seems passing in a NativeWindow to the constructor of OffScreenRenderWidgetHostView became optional with the intent that SetOwnerWindow would call into SetNativeWindow -- 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 returns nullptr (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 the OffScreenRenderWidgetHostView with a valid NativeWindow.

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 in OffScreenWebContentsView but it, of course, has no entry until SetOwnerWindow is called.

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes
  • PR title follows semantic commit guidelines

Release Notes

Notes: fix: move NativeWindow tracking to OSR WCV

Copy link
Contributor

@brenca brenca left a 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.

@adill adill requested review from a team November 6, 2018 19:38
@adill adill changed the base branch from 4-0-x to master November 6, 2018 19:39
@adill
Copy link
Contributor Author

adill commented Nov 6, 2018

@brenca Thanks! I updated the branch with your patch.

@adill adill changed the title fix: pass NativeWindow to OSR WHV to ensure it initializes correctly fix: move NativeWindow tracking to OSR WCV Nov 6, 2018
Copy link
Contributor

@brenca brenca left a 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?

Copy link
Contributor

@groundwater groundwater left a 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

@codebytere
Copy link
Member

@zcbenz this needs your approval for the two missing codeowner teams when you have a moment :)

@codebytere codebytere merged commit 8cca1c9 into electron:master Nov 30, 2018
@release-clerk
Copy link

release-clerk bot commented Nov 30, 2018

Release Notes Persisted

fix: move NativeWindow tracking to OSR WCV

@adill adill deleted the fix-osr-owner-window branch December 5, 2018 17:01
@codebytere
Copy link
Member

/trop run backport-to 4-0-x

@trop
Copy link
Contributor

trop bot commented Dec 6, 2018

The backport process for this PR has been manually initiated,
sending your 1's and 0's to "4-0-x" here we go! :D

@trop
Copy link
Contributor

trop bot commented Dec 6, 2018

I was unable to backport this PR to "4-0-x" cleanly;
you will need to perform this backport manually.

codebytere pushed a commit that referenced this pull request Dec 6, 2018
* fix: move NativeWindow tracking to OSR WCV

* fix oops
codebytere added a commit that referenced this pull request Dec 10, 2018
* fix: move NativeWindow tracking to OSR WCV

* fix oops
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants