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

Commit

Permalink
Dispatch fullscreen change notification on recreated sessions (#3196)
Browse files Browse the repository at this point in the history
* Dispatch fullscreen change notification on recreated sessions

* Do not restore composited when exiting fullscreen
  • Loading branch information
MortimerGoro authored Apr 20, 2020
1 parent cc207c7 commit 799f4b7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@ private GeckoSession createGeckoSession(@NonNull SessionSettings aSettings) {
}

public void recreateSession() {
boolean wasFullScreen = mState.mFullScreen;

SessionState previous = mState;
mState = mState.recreate();

Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 799f4b7

Please sign in to comment.