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

Commit b8ccd64

Browse files
MortimerGorokeianhzo
authored andcommitted
Post firstDrawCallback runnable to avoid a deadlock if the widget is resized in that callback. (#1486)
1 parent 648c8c4 commit b8ccd64

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/WindowWidget.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import android.view.inputmethod.EditorInfo;
1818
import android.view.inputmethod.InputConnection;
1919

20+
import org.mozilla.gecko.util.ThreadUtils;
2021
import org.mozilla.geckoview.AllowOrDeny;
2122
import org.mozilla.geckoview.GeckoDisplay;
2223
import org.mozilla.geckoview.GeckoResult;
@@ -782,7 +783,9 @@ public void onCrash(GeckoSession session) {
782783
@Override
783784
public void onFirstComposite(GeckoSession session) {
784785
if (mFirstDrawCallback != null) {
785-
mFirstDrawCallback.run();
786+
// Post this call because running it synchronously can cause a deadlock if the runnable
787+
// resizes the widget and calls surfaceChanged. See https://github.com/MozillaReality/FirefoxReality/issues/1459.
788+
ThreadUtils.postToUiThread(mFirstDrawCallback);
786789
mFirstDrawCallback = null;
787790
}
788791
}

0 commit comments

Comments
 (0)