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

Commit

Permalink
Only capture screenshots if the first paint is ready (#2304)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro authored and bluemarvin committed Nov 18, 2019
1 parent 2333f6e commit 6f898f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ public void setFirstDrawCallback(Runnable aRunnable) {

@Override
public boolean isFirstPaintReady() {
return mWidgetPlacement.composited;
return mWidgetPlacement != null && mWidgetPlacement.composited;
}

@Override
Expand Down Expand Up @@ -1536,7 +1536,9 @@ public void onPageStart(@NonNull GeckoSession geckoSession, @NonNull String s) {
public void onPageStop(@NonNull GeckoSession aSession, boolean b) {
if (mCaptureOnPageStop || !mSession.hasCapturedBitmap()) {
mCaptureOnPageStop = false;
captureImage();
if (isFirstPaintReady()) {
captureImage();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,9 @@ public void onTabsClicked() {

// Capture active session snapshots when showing the tabs menu
for (WindowWidget window: getCurrentWindows()) {
window.captureImage();
if (window.isFirstPaintReady()) {
window.captureImage();
}
}
}

Expand Down

0 comments on commit 6f898f0

Please sign in to comment.