From d0294c357f5fc43b822af0ad8ed5e0bb368041d1 Mon Sep 17 00:00:00 2001 From: Imanol Fernandez Date: Thu, 14 Nov 2019 23:28:56 +0100 Subject: [PATCH] Do not let a received tab take ownership of the window when the window is full-screened or playing a immersive video (#2269) --- .../shared/org/mozilla/vrbrowser/ui/widgets/Windows.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java index 57e64a1e7..d57bf0afa 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java @@ -1245,6 +1245,7 @@ public void onTabsClose(ArrayList aTabs) { @Override public void onTabsReceived(@NotNull List 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 @@ -1253,14 +1254,16 @@ public void onTabsReceived(@NotNull List 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();