diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java index 3330be78e..06bfe34f2 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java @@ -512,6 +512,8 @@ private GeckoSession createGeckoSession(@NonNull SessionSettings aSettings) { } public void recreateSession() { + boolean wasFullScreen = mState.mFullScreen; + SessionState previous = mState; mState = mState.recreate(); @@ -529,6 +531,12 @@ public void recreateSession() { for (SessionChangeListener listener : mSessionChangeListeners) { listener.onCurrentSessionChange(previousGeckoSession, mState.mSession); } + + if (wasFullScreen != mState.mFullScreen) { + for (GeckoSession.ContentDelegate listener : mContentListeners) { + listener.onFullScreen(mState.mSession, mState.mFullScreen); + } + } } private void closeSession(@NonNull SessionState aState) { diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java index e553c96fd..bd86b6442 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java @@ -557,6 +557,7 @@ private void cleanSession(@NonNull Session aSession) { public void onSessionChanged(@NonNull Session aOldSession, @NonNull Session aSession) { cleanSession(aOldSession); setUpSession(aSession); + exitFullScreenMode(); } @Override diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java index d02a7e214..42d0e2969 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java @@ -917,8 +917,12 @@ public void saveBeforeFullscreenPlacement() { } public void restoreBeforeFullscreenPlacement() { + // We need to process `composited` separately to handle GV content process onCrash/onKill. + // Composited is false after a content crash but it was true when the placement was saved. + boolean composited = mWidgetPlacement.composited; mWindowPlacement = mWindowPlacementBeforeFullscreen; mWidgetPlacement.copyFrom(mPlacementBeforeFullscreen); + mWidgetPlacement.composited = composited; } public WidgetPlacement getBeforeFullscreenPlacement() {