Skip to content

Commit

Permalink
Set session stack active state based on the window visibility (#1717)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored and bluemarvin committed Aug 30, 2019
1 parent 9f84d3f commit 2f3c8a8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,6 @@ protected void onPause() {
}
mAudioEngine.pauseEngine();

SessionStore.get().onPause();

mWindows.onPause();

for (Widget widget: mWidgets.values()) {
Expand All @@ -365,7 +363,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 @@ -837,6 +851,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 @@ -364,6 +364,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

0 comments on commit 2f3c8a8

Please sign in to comment.