Skip to content

Commit

Permalink
Ensure that compositor is resumed after onResume (#3141)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro committed Apr 9, 2020
1 parent 4c3c39b commit 2d38f82
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class WindowsState {
private Accounts mAccounts;
private Services mServices;
private PromptDialogWidget mNoInternetDialog;
private boolean mCompositorPaused = false;

private enum PanelType {
NONE,
Expand Down Expand Up @@ -428,6 +429,10 @@ public void focusWindow(@Nullable WindowWidget aWindow) {
}

public void pauseCompositor() {
if (mCompositorPaused) {
return;
}
mCompositorPaused = true;
for (WindowWidget window: mRegularWindows) {
window.pauseCompositor();
}
Expand All @@ -437,6 +442,10 @@ public void pauseCompositor() {
}

public void resumeCompositor() {
if (!mCompositorPaused) {
return;
}
mCompositorPaused = false;
for (WindowWidget window: mRegularWindows) {
window.resumeCompositor();
}
Expand All @@ -453,6 +462,9 @@ public void onPause() {

public void onResume() {
mIsPaused = false;
if (mCompositorPaused) {
resumeCompositor();
}

TelemetryWrapper.resetOpenedWindowsCount(mRegularWindows.size(), false);
TelemetryWrapper.resetOpenedWindowsCount(mPrivateWindows.size(), true);
Expand Down

0 comments on commit 2d38f82

Please sign in to comment.