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

Commit 799f4b7

Browse files
authoredApr 20, 2020
Dispatch fullscreen change notification on recreated sessions (#3196)
* Dispatch fullscreen change notification on recreated sessions * Do not restore composited when exiting fullscreen
1 parent cc207c7 commit 799f4b7

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed
 

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

+8
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ private GeckoSession createGeckoSession(@NonNull SessionSettings aSettings) {
512512
}
513513

514514
public void recreateSession() {
515+
boolean wasFullScreen = mState.mFullScreen;
516+
515517
SessionState previous = mState;
516518
mState = mState.recreate();
517519

@@ -529,6 +531,12 @@ public void recreateSession() {
529531
for (SessionChangeListener listener : mSessionChangeListeners) {
530532
listener.onCurrentSessionChange(previousGeckoSession, mState.mSession);
531533
}
534+
535+
if (wasFullScreen != mState.mFullScreen) {
536+
for (GeckoSession.ContentDelegate listener : mContentListeners) {
537+
listener.onFullScreen(mState.mSession, mState.mFullScreen);
538+
}
539+
}
532540
}
533541

534542
private void closeSession(@NonNull SessionState aState) {

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

+1
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,7 @@ private void cleanSession(@NonNull Session aSession) {
557557
public void onSessionChanged(@NonNull Session aOldSession, @NonNull Session aSession) {
558558
cleanSession(aOldSession);
559559
setUpSession(aSession);
560+
exitFullScreenMode();
560561
}
561562

562563
@Override

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

+4
Original file line numberDiff line numberDiff line change
@@ -917,8 +917,12 @@ public void saveBeforeFullscreenPlacement() {
917917
}
918918

919919
public void restoreBeforeFullscreenPlacement() {
920+
// We need to process `composited` separately to handle GV content process onCrash/onKill.
921+
// Composited is false after a content crash but it was true when the placement was saved.
922+
boolean composited = mWidgetPlacement.composited;
920923
mWindowPlacement = mWindowPlacementBeforeFullscreen;
921924
mWidgetPlacement.copyFrom(mPlacementBeforeFullscreen);
925+
mWidgetPlacement.composited = composited;
922926
}
923927

924928
public WidgetPlacement getBeforeFullscreenPlacement() {

0 commit comments

Comments
 (0)
This repository has been archived.