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

Commit 5a2f2cb3 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Fixed issue with relaying-out sysui when resizing a freeform task.

WindowState.getTask() was returning the focusedApp task for windows
without an AppToken (e.g. status bar, nava bar, wallpaper). We then
check to see if the config associated with the task has changed and
tell the client window to resize if it as. The config would have
changed in this case since we are using the focus app task
(task we are currently resizing) to determine config changes for all
windows without appTokens. Changed the logic so this is no longer the
case.

Also, cleaned-up the use of getTask().

Bug: 23939846
Change-Id: I473671021282695d282a8a2b82d679722273ca09
parent e75553ab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -288,7 +288,7 @@ class DisplayContent {
        final int delta = mService.dipToPixel(RESIZE_HANDLE_WIDTH_IN_DP, mDisplayMetrics);
        for (int i = windows.size() - 1; i >= 0; --i) {
            final WindowState win = windows.get(i);
            final Task task = win.mAppToken != null ? win.getTask() : null;
            final Task task = win.getTask();
            if (win.isVisibleLw() && task != null) {
                /**
                 * Exclusion region is the region that TapDetector doesn't care about.
+5 −10
Original line number Diff line number Diff line
@@ -557,7 +557,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
        }
        mHaveFrame = true;

        final Task task = mAppToken != null ? getTask() : null;
        final Task task = getTask();
        final boolean nonFullscreenTask = task != null && !task.isFullscreen();
        final boolean freeformWorkspace = task != null && task.inFreeformWorkspace();
        if (nonFullscreenTask) {
@@ -916,12 +916,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
    }

    Task getTask() {
        AppWindowToken wtoken = mAppToken == null ? mService.mFocusedApp : mAppToken;
        if (wtoken == null) {
            return null;
        }
        final Task task = wtoken.mTask;
        return task;
        return mAppToken != null ? mAppToken.mTask : null;
    }

    TaskStack getStack() {
@@ -931,7 +926,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
                return task.mStack;
            }
        }
        return mDisplayContent.getHomeStack();
        return null;
    }

    /**
@@ -1691,12 +1686,12 @@ final class WindowState implements WindowManagerPolicy.WindowState {
    }

    boolean inFreeformWorkspace() {
        final Task task = mAppToken != null ? getTask() : null;
        final Task task = getTask();
        return task != null && task.inFreeformWorkspace();
    }

    boolean isDragResizing() {
        final Task task = mAppToken != null ? getTask() : null;
        final Task task = getTask();
        return mService.mTaskPositioner != null && mService.mTaskPositioner.isTaskResizing(task);
    }

+5 −2
Original line number Diff line number Diff line
@@ -625,8 +625,11 @@ class WindowSurfacePlacer {

            for (int i = windows.size() - 1; i >= 0; i--) {
                WindowState w = windows.get(i);
                final Task task = w.getTask();
                if (task == null && w.getAttrs().type != TYPE_PRIVATE_PRESENTATION) {
                Task task = w.getTask();
                if (task == null && w.getDisplayContent().getHomeStack() == null
                        && w.getAttrs().type != TYPE_PRIVATE_PRESENTATION) {
                    // TODO: Understand what the use case is here and see if the conditions can be
                    // simplified.
                    continue;
                }