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

Commit 2a88fc31 authored by Chong Zhang's avatar Chong Zhang
Browse files

Apply scroll to windows added to a non-resizeble task that's docked

bug: 26447921
Change-Id: I933e277137fb127a9e961035cf48cba2bef52042
parent a16a704a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -393,7 +393,7 @@ class DisplayContent {
                    }
                    mTouchExcludeRegion.op(mTmpRect, Region.Op.DIFFERENCE);
                }
                if (task.isDockedInEffect() && !task.isResizeable()) {
                if (task.isTwoFingerScrollMode()) {
                    stack.getBounds(mTmpRect);
                    mNonResizeableRegion.op(mTmpRect, Region.Op.UNION);
                    break;
+4 −0
Original line number Diff line number Diff line
@@ -571,6 +571,10 @@ class Task implements DimLayer.DimLayerUser {
        return inDockedWorkspace() || isResizeableByDockedStack();
    }

    boolean isTwoFingerScrollMode() {
        return isDockedInEffect() && !isResizeable();
    }

    WindowState getTopVisibleAppMainWindow() {
        final AppWindowToken token = getTopVisibleAppToken();
        return token != null ? token.findMainWindow() : null;
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ public class TaskStack implements DimLayer.DimLayerUser {
            Configuration config = configs.get(task.mTaskId);
            if (config != null) {
                Rect bounds = taskBounds.get(task.mTaskId);
                if (!task.isResizeable() && task.isDockedInEffect()) {
                if (task.isTwoFingerScrollMode()) {
                    // This is a non-resizeable task that's docked (or side-by-side to the docked
                    // stack). It might have been scrolled previously, and after the stack resizing,
                    // it might no longer fully cover the stack area.
+4 −0
Original line number Diff line number Diff line
@@ -1990,6 +1990,10 @@ public class WindowManagerService extends IWindowManager.Stub
                }
            }

            // If the window is being added to a task that's docked but non-resizeable,
            // we need to update this new window's scroll position when it's added.
            win.applyScrollIfNeeded();

            if (type == TYPE_DOCK_DIVIDER) {
                getDefaultDisplayContentLocked().getDockedDividerController().setWindow(win);
            }
+11 −2
Original line number Diff line number Diff line
@@ -1458,15 +1458,24 @@ final class WindowState implements WindowManagerPolicy.WindowState {
    }

    boolean inDockedWorkspace() {
        Task task = getTask();
        final Task task = getTask();
        return task != null && task.inDockedWorkspace();
    }

    boolean isDockedInEffect() {
        Task task = getTask();
        final Task task = getTask();
        return task != null && task.isDockedInEffect();
    }

    void applyScrollIfNeeded() {
        final Task task = getTask();
        if (task != null && task.isTwoFingerScrollMode()) {
            task.getDimBounds(mTmpRect);
            mXOffset = mTmpRect.left;
            mYOffset = mTmpRect.top;
        }
    }

    int getTouchableRegion(Region region, int flags) {
        final boolean modal = (flags & (FLAG_NOT_TOUCH_MODAL | FLAG_NOT_FOCUSABLE)) == 0;
        if (modal && mAppToken != null) {