Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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.
Jump to
Jump to file
Failed to load files.
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