Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Ensure that display is recreated after sessions are restored (#2902)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro authored Mar 2, 2020
1 parent 0e9791f commit c2a5eb4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@ public void onResume() {
super.onResume();
if (isVisible() || mIsInVRVideoMode) {
mSession.setActive(true);
if (!SettingsStore.getInstance(getContext()).getLayersEnabled()) {
// Ensure the Gecko Display is correctly recreated.
// See: https://github.com/MozillaReality/FirefoxReality/issues/2880
callSurfaceChanged();
}
}
}

Expand Down Expand Up @@ -732,7 +737,7 @@ public void setSurface(Surface aSurface, final int aWidth, final int aHeight, Ru
}

private void callSurfaceChanged() {
if (mSession != null) {
if (mSession != null && mSurface != null) {
mSession.surfaceChanged(mSurface, mBorderWidth, mBorderWidth, mWidth - mBorderWidth * 2, mHeight - mBorderWidth * 2);
mSession.updateLastUse();
}
Expand Down

0 comments on commit c2a5eb4

Please sign in to comment.