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

Commit

Permalink
Fix gray window when loading tab is replaced with already loaded tab
Browse files Browse the repository at this point in the history
  • Loading branch information
bluemarvin committed Nov 14, 2019
1 parent 24d4328 commit ebf452b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,11 @@ private void setFirstPaint(@NonNull final WindowWidget aWindow, @NonNull final S
}
});
mWidgetManager.updateWidget(aWindow);
} else {
// If the new session has a GeckoSession there won't be a first paint event.
// So trigger the first paint callback in case the window is grayed out
// waiting for the first paint event.
aWindow.onFirstContentfulPaint(aSession.getGeckoSession());
}
}

Expand Down Expand Up @@ -1152,9 +1157,10 @@ public void addTab(WindowWidget targetWindow) {
}

public void addTab(@NotNull WindowWidget targetWindow, @Nullable String aUri) {
Session session = SessionStore.get().createSession(targetWindow.getSession().isPrivateMode());
Session session = SessionStore.get().createSuspendedSession(aUri, targetWindow.getSession().isPrivateMode());
setFirstPaint(targetWindow, session);
targetWindow.getSession().setActive(false);
session.setActive(true);
targetWindow.setSession(session);
if (aUri == null || aUri.isEmpty()) {
session.loadHomePage();
Expand Down

0 comments on commit ebf452b

Please sign in to comment.