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

Commit 441566d

Browse files
authored
Prevent duplicated callSurfaceChanged call when exiting immersive mode (#2961)
1 parent b958efb commit 441566d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,10 @@ public boolean hasCapturedBitmap() {
544544
return BitmapCache.getInstance(mContext).hasBitmap(mState.mId);
545545
}
546546

547+
public boolean hasDisplay() {
548+
return mState != null && mState.mDisplay != null;
549+
}
550+
547551
public void purgeHistory() {
548552
if (mState.mSession != null) {
549553
mState.mSession.purgeHistory();

app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public void onResume() {
314314
super.onResume();
315315
if (isVisible() || mIsInVRVideoMode) {
316316
mSession.setActive(true);
317-
if (!SettingsStore.getInstance(getContext()).getLayersEnabled()) {
317+
if (!SettingsStore.getInstance(getContext()).getLayersEnabled() && !mSession.hasDisplay()) {
318318
// Ensure the Gecko Display is correctly recreated.
319319
// See: https://github.com/MozillaReality/FirefoxReality/issues/2880
320320
callSurfaceChanged();

0 commit comments

Comments
 (0)