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

Set session stack active state based on the window visibility #1717

Merged
merged 1 commit into from
Aug 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,6 @@ protected void onPause() {
}
mAudioEngine.pauseEngine();

SessionStore.get().onPause();

mWindows.onPause();

for (Widget widget: mWidgets.values()) {
Expand All @@ -360,7 +358,7 @@ protected void onResume() {
mOffscreenDisplay.onResume();
}

SessionStore.get().onResume();
mWindows.onResume();

mAudioEngine.resumeEngine();
for (Widget widget: mWidgets.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,20 @@ protected void onDismiss() {
}
}

@Override
public void onPause() {
super.onPause();
mSessionStack.setActive(false);
}

@Override
public void onResume() {
super.onResume();
if (isVisible()) {
mSessionStack.setActive(true);
}
}

public void close() {
TelemetryWrapper.closeWindowEvent(mWindowId);

Expand Down Expand Up @@ -820,6 +834,7 @@ public void setVisible(boolean aVisible) {
if (mWidgetPlacement.visible == aVisible) {
return;
}
mSessionStack.setActive(aVisible);
mWidgetPlacement.visible = aVisible;
if (!aVisible) {
if (mIsBookmarksVisible || mIsHistoryVisible) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,21 @@ public void resumeCompositor() {

public void onPause() {
saveState();
for (WindowWidget window: mRegularWindows) {
window.onPause();
}
for (WindowWidget window: mPrivateWindows) {
window.onPause();
}
}

public void onResume() {
for (WindowWidget window: mRegularWindows) {
window.onResume();
}
for (WindowWidget window: mPrivateWindows) {
window.onResume();
}
}

public void onDestroy() {
Expand Down