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

Post firstDrawCallback to avoid a deadlock if the widget is resized in that callback. #1486

Merged
merged 1 commit into from
Aug 2, 2019
Merged
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 @@ -17,6 +17,7 @@
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;

import org.mozilla.gecko.util.ThreadUtils;
import org.mozilla.geckoview.AllowOrDeny;
import org.mozilla.geckoview.GeckoDisplay;
import org.mozilla.geckoview.GeckoResult;
Expand Down Expand Up @@ -782,7 +783,9 @@ public void onCrash(GeckoSession session) {
@Override
public void onFirstComposite(GeckoSession session) {
if (mFirstDrawCallback != null) {
mFirstDrawCallback.run();
// Post this call because running it synchronously can cause a deadlock if the runnable
// resizes the widget and calls surfaceChanged. See https://github.com/MozillaReality/FirefoxReality/issues/1459.
ThreadUtils.postToUiThread(mFirstDrawCallback);
mFirstDrawCallback = null;
}
}
Expand Down