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

Ensure that display is recreated after sessions are restored #2902

Merged
merged 1 commit into from
Mar 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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