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

Commit 253a20fa authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Fix black holes and flickering in docked resizing

When we start a resize with the docked stack divider,
set the surface background to be full-screen, and use
the traditional surface clipping/positioning in window
manager to adjust the size. This ensures that we don't
have any black holes because of asynchronicity (except
at the very beginning, but this can be worked around
later), and the position of the right/bottom activity
is always in sync with the position of the divider.

Also fix a bug in NonClientDecorView where the first
request to draw was dropped (because the thread hasn't
started up yet), and the main thread was waiting for it
indefinitily.

Bug: 24507122
Change-Id: I623bd48d5be64fac2fba45241b84f265944d200d
parent 61f39a7b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ public abstract class WallpaperService extends Service {
            @Override
            public void resized(Rect frame, Rect overscanInsets, Rect contentInsets,
                    Rect visibleInsets, Rect stableInsets, Rect outsets, boolean reportDraw,
                    Configuration newConfig) {
                    Configuration newConfig, Rect backDropRect) {
                Message msg = mCaller.obtainMessageIO(MSG_WINDOW_RESIZED,
                        reportDraw ? 1 : 0, outsets);
                mCaller.sendMessage(msg);
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ oneway interface IWindow {

    void resized(in Rect frame, in Rect overscanInsets, in Rect contentInsets,
            in Rect visibleInsets, in Rect stableInsets, in Rect outsets, boolean reportDraw,
            in Configuration newConfig);
            in Configuration newConfig, in Rect backDropFrame);
    void moved(int newX, int newY);
    void dispatchAppVisibility(boolean visible);
    void dispatchGetNewSurface();
+1 −1
Original line number Diff line number Diff line
@@ -668,7 +668,7 @@ public class SurfaceView extends View {
        @Override
        public void resized(Rect frame, Rect overscanInsets, Rect contentInsets,
                Rect visibleInsets, Rect stableInsets, Rect outsets, boolean reportDraw,
                Configuration newConfig) {
                Configuration newConfig, Rect backDropRect) {
            SurfaceView surfaceView = mSurfaceView.get();
            if (surfaceView != null) {
                if (DEBUG) Log.v(
+4 −4
Original line number Diff line number Diff line
@@ -5647,7 +5647,7 @@ public final class ViewRootImpl implements ViewParent,

    public void dispatchResized(Rect frame, Rect overscanInsets, Rect contentInsets,
            Rect visibleInsets, Rect stableInsets, Rect outsets, boolean reportDraw,
            Configuration newConfig) {
            Configuration newConfig, Rect backDropFrame) {
        if (DEBUG_LAYOUT) Log.v(TAG, "Resizing " + this + ": frame=" + frame.toShortString()
                + " contentInsets=" + contentInsets.toShortString()
                + " visibleInsets=" + visibleInsets.toShortString()
@@ -5658,7 +5658,7 @@ public final class ViewRootImpl implements ViewParent,
        if (mDragResizing) {
            synchronized (mWindowCallbacks) {
                for (int i = mWindowCallbacks.size() - 1; i >= 0; i--) {
                    mWindowCallbacks.get(i).onWindowSizeIsChanging(frame);
                    mWindowCallbacks.get(i).onWindowSizeIsChanging(backDropFrame);
                }
            }
        }
@@ -6677,11 +6677,11 @@ public final class ViewRootImpl implements ViewParent,
        @Override
        public void resized(Rect frame, Rect overscanInsets, Rect contentInsets,
                Rect visibleInsets, Rect stableInsets, Rect outsets, boolean reportDraw,
                Configuration newConfig) {
                Configuration newConfig, Rect backDropFrame) {
            final ViewRootImpl viewAncestor = mViewAncestor.get();
            if (viewAncestor != null) {
                viewAncestor.dispatchResized(frame, overscanInsets, contentInsets,
                        visibleInsets, stableInsets, outsets, reportDraw, newConfig);
                        visibleInsets, stableInsets, outsets, reportDraw, newConfig, backDropFrame);
            }
        }

+2 −1
Original line number Diff line number Diff line
@@ -35,7 +35,8 @@ public class BaseIWindow extends IWindow.Stub {

    @Override
    public void resized(Rect frame, Rect overscanInsets, Rect contentInsets, Rect visibleInsets,
            Rect stableInsets, Rect outsets, boolean reportDraw, Configuration newConfig) {
            Rect stableInsets, Rect outsets, boolean reportDraw, Configuration newConfig,
            Rect backDropFrame) {
        if (reportDraw) {
            try {
                mSession.finishDrawing(this);
Loading