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

Commit

Permalink
Deactivate current session when receiving a new tab (#2284)
Browse files Browse the repository at this point in the history
* Deactivate current session when receiving a new tab

* deactivate the previous session if not in fullscreen
  • Loading branch information
keianhzo authored and bluemarvin committed Nov 18, 2019
1 parent b262362 commit 19c4722
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,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());
Expand All @@ -1262,6 +1263,7 @@ public void onTabsReceived(@NotNull List<TabData> aTabs) {
if (i == 0 && !fullscreen) {
// Set the first received tab of the list the current one.
SessionStore.get().setActiveSession(session);
targetWindow.getSession().setActive(false);
targetWindow.setSession(session);
}
}
Expand Down

0 comments on commit 19c4722

Please sign in to comment.