@@ -1211,7 +1211,9 @@ public void onTabSelect(Session aTab) {
1211
1211
Session moveTo = targetWindow .getSession ();
1212
1212
moveFrom .surfaceDestroyed ();
1213
1213
moveTo .surfaceDestroyed ();
1214
+ windowToMove .setupListeners (moveTo );
1214
1215
windowToMove .setSession (moveTo , WindowWidget .SESSION_DO_NOT_RELEASE_DISPLAY );
1216
+ targetWindow .setupListeners (moveFrom );
1215
1217
targetWindow .setSession (moveFrom , WindowWidget .SESSION_DO_NOT_RELEASE_DISPLAY );
1216
1218
SessionStore .get ().setActiveSession (targetWindow .getSession ());
1217
1219
windowToMove .setActiveWindow (false );
@@ -1220,6 +1222,7 @@ public void onTabSelect(Session aTab) {
1220
1222
} else {
1221
1223
setFirstPaint (targetWindow , aTab );
1222
1224
targetWindow .getSession ().setActive (false );
1225
+ targetWindow .setupListeners (aTab );
1223
1226
aTab .setActive (true );
1224
1227
targetWindow .setSession (aTab );
1225
1228
SessionStore .get ().setActiveSession (aTab );
@@ -1234,6 +1237,7 @@ public void addTab(@NonNull WindowWidget targetWindow, @Nullable String aUri) {
1234
1237
Session session = SessionStore .get ().createSuspendedSession (aUri , targetWindow .getSession ().isPrivateMode ());
1235
1238
setFirstPaint (targetWindow , session );
1236
1239
targetWindow .getSession ().setActive (false );
1240
+ targetWindow .setupListeners (session );
1237
1241
session .setActive (true );
1238
1242
targetWindow .setSession (session );
1239
1243
if (aUri == null || aUri .isEmpty ()) {
@@ -1297,6 +1301,7 @@ public void onTabsClose(ArrayList<Session> aTabs) {
1297
1301
Session tab = available .get (0 );
1298
1302
if (tab != null ) {
1299
1303
setFirstPaint (window , tab );
1304
+ window .setupListeners (tab );
1300
1305
tab .setActive (true );
1301
1306
window .setSession (tab );
1302
1307
}
@@ -1336,6 +1341,7 @@ public void onTabsReceived(@NonNull List<TabData> aTabs) {
1336
1341
if (i == 0 && !fullscreen ) {
1337
1342
// Set the first received tab of the list the current one.
1338
1343
SessionStore .get ().setActiveSession (session );
1344
+ targetWindow .setupListeners (session );
1339
1345
targetWindow .getSession ().setActive (false );
1340
1346
targetWindow .setSession (session );
1341
1347
}
0 commit comments