Skip to content

Commit

Permalink
Prevent duplicated callSurfaceChanged call when exiting immersive mode (
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro committed Mar 13, 2020
1 parent b958efb commit 441566d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -544,6 +544,10 @@ public boolean hasCapturedBitmap() {
return BitmapCache.getInstance(mContext).hasBitmap(mState.mId);
}

public boolean hasDisplay() {
return mState != null && mState.mDisplay != null;
}

public void purgeHistory() {
if (mState.mSession != null) {
mState.mSession.purgeHistory();
Expand Down
Expand Up @@ -314,7 +314,7 @@ public void onResume() {
super.onResume();
if (isVisible() || mIsInVRVideoMode) {
mSession.setActive(true);
if (!SettingsStore.getInstance(getContext()).getLayersEnabled()) {
if (!SettingsStore.getInstance(getContext()).getLayersEnabled() && !mSession.hasDisplay()) {
// Ensure the Gecko Display is correctly recreated.
// See: https://github.com/MozillaReality/FirefoxReality/issues/2880
callSurfaceChanged();
Expand Down

0 comments on commit 441566d

Please sign in to comment.