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

Commit

Permalink
Do not let a received tab take ownership of the window when the windo…
Browse files Browse the repository at this point in the history
…w is full-screened or playing a immersive video (#2269)
  • Loading branch information
MortimerGoro authored and bluemarvin committed Nov 14, 2019
1 parent 3a9f84d commit d0294c3
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,7 @@ public void onTabsClose(ArrayList<Session> aTabs) {
@Override
public void onTabsReceived(@NotNull List<TabData> aTabs) {
WindowWidget targetWindow = mFocusedWindow;
boolean fullscreen = targetWindow.getSession().isInFullScreen();
for (int i = aTabs.size() - 1; i >= 0; --i) {
Session session = SessionStore.get().createSession(targetWindow.getSession().isPrivateMode());
// Cache the provided data to avoid delays if the tabs are loaded at the same time the
Expand All @@ -1253,14 +1254,16 @@ public void onTabsReceived(@NotNull List<TabData> aTabs) {
session.getSessionState().mUri = aTabs.get(i).getUrl();
session.loadUri(aTabs.get(i).getUrl());
session.updateLastUse();
if (i == 0) {
if (i == 0 && !fullscreen) {
// Set the first received tab of the list the current one.
SessionStore.get().setActiveSession(session);
targetWindow.setSession(session);
}
}

mWidgetManager.getTray().showTabAddedNotification();
if (!fullscreen) {
mWidgetManager.getTray().showTabAddedNotification();
}

if (mTabsWidget != null && mTabsWidget.isVisible()) {
mTabsWidget.refreshTabs();
Expand Down

0 comments on commit d0294c3

Please sign in to comment.