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

Commit 1bcc100c authored by Kazuki Takise's avatar Kazuki Takise
Browse files

Move display to top when task gets moved to front in desktop mode

When a task gets moved to front, the dipslay the task is on should
also come on top and get display focus, but this isn't working now
when caption bar is clicked because the includingParents param of
WCT#reorder() is set to false as its default value.

Bug: 368200134
Bug: 371086263
Flag: EXEMPT bugfix
Test: atest WMShellUnitTests
Change-Id: If4cf47796d30e76398153e823fa5082746dd636f
parent 6dd05c69
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -581,7 +581,7 @@ class DesktopTasksController(
    fun moveTaskToFront(taskInfo: RunningTaskInfo) {
        logV("moveTaskToFront taskId=%s", taskInfo.taskId)
        val wct = WindowContainerTransaction()
        wct.reorder(taskInfo.token, true)
        wct.reorder(taskInfo.token, true /* onTop */, true /* includingParents */)
        val taskToMinimize =
            addAndGetMinimizeChangesIfNeeded(taskInfo.displayId, wct, taskInfo.taskId)
        if (Transitions.ENABLE_SHELL_TRANSITIONS) {
+1 −1
Original line number Diff line number Diff line
@@ -361,7 +361,7 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel {
                final RunningTaskInfo taskInfo = mTaskOrganizer.getRunningTaskInfo(mTaskId);
                if (!taskInfo.isFocused) {
                    final WindowContainerTransaction wct = new WindowContainerTransaction();
                    wct.reorder(mTaskToken, true /* onTop */);
                    wct.reorder(mTaskToken, true /* onTop */, true /* includingParents */);
                    mSyncQueue.queue(wct);
                }
            }
+2 −1
Original line number Diff line number Diff line
@@ -95,7 +95,8 @@ class FluidResizeTaskPositioner implements TaskPositioner, Transitions.Transitio
        mDragStartListener.onDragStart(mWindowDecoration.mTaskInfo.taskId);
        if (mCtrlType != CTRL_TYPE_UNDEFINED && !mWindowDecoration.mTaskInfo.isFocused) {
            WindowContainerTransaction wct = new WindowContainerTransaction();
            wct.reorder(mWindowDecoration.mTaskInfo.token, true);
            wct.reorder(mWindowDecoration.mTaskInfo.token, true /* onTop */,
                    true /* includingParents */);
            mTaskOrganizer.applyTransaction(wct);
        }
        mRepositionTaskBounds.set(mTaskBoundsAtDragStart);
+2 −1
Original line number Diff line number Diff line
@@ -108,7 +108,8 @@ public class VeiledResizeTaskPositioner implements TaskPositioner, Transitions.T
                    mDesktopWindowDecoration.mContext, mHandler, CUJ_DESKTOP_MODE_RESIZE_WINDOW);
            if (!mDesktopWindowDecoration.mTaskInfo.isFocused) {
                WindowContainerTransaction wct = new WindowContainerTransaction();
                wct.reorder(mDesktopWindowDecoration.mTaskInfo.token, true);
                wct.reorder(mDesktopWindowDecoration.mTaskInfo.token, true /* onTop */,
                        true /* includingParents */);
                mTaskOrganizer.applyTransaction(wct);
            }
        }