Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87a0bfdf authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Do not forceLayout when window is resized

WindowManager uses a resize message when forcing a window to be
redrawn, which then triggered a full layout pass, which is
excessive and unnecessary. A normal requestLayout() should suffice
for this case.

Bug: 18573811
Change-Id: I1e9ef807094b1e0afb32d13fd68b67c3957b15c3
parent 421d6ad1
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -3080,17 +3080,6 @@ public final class ViewRootImpl implements ViewParent,
        return (theParent instanceof ViewGroup) && isViewDescendantOf((View) theParent, parent);
    }

    private static void forceLayout(View view) {
        view.forceLayout();
        if (view instanceof ViewGroup) {
            ViewGroup group = (ViewGroup) view;
            final int count = group.getChildCount();
            for (int i = 0; i < count; i++) {
                forceLayout(group.getChildAt(i));
            }
        }
    }

    private final static int MSG_INVALIDATE = 1;
    private final static int MSG_INVALIDATE_RECT = 2;
    private final static int MSG_DIE = 3;
@@ -3224,10 +3213,6 @@ public final class ViewRootImpl implements ViewParent,
                        mReportNextDraw = true;
                    }

                    if (mView != null) {
                        forceLayout(mView);
                    }

                    requestLayout();
                }
                break;
@@ -3242,9 +3227,6 @@ public final class ViewRootImpl implements ViewParent,
                    mWinFrame.top = t;
                    mWinFrame.bottom = t + h;

                    if (mView != null) {
                        forceLayout(mView);
                    }
                    requestLayout();
                }
                break;