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

Commit 971e0f2b authored by mattsziklay's avatar mattsziklay
Browse files

Base Manage Windows header position on task coordinates.

For freeform tasks, the manage windows menu was using captionX /
captionY values, which are both 0. This CL changes it to task left/top.

Bug: 380268041
Test: Manual
Flag: EXEMPT bugfix
Change-Id: Ib405e11dc2d67ae2c86fcf5e4058c93df3954c4a
parent 94bf7a71
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1459,10 +1459,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
            @NonNull Function1<Integer, Unit> onIconClickListener
    ) {
        if (mTaskInfo.isFreeform()) {
            // The menu uses display-wide coordinates for positioning, so make position the sum
            // of task position and caption position.
            final Rect taskBounds = mTaskInfo.configuration.windowConfiguration.getBounds();
            mManageWindowsMenu = new DesktopHeaderManageWindowsMenu(
                    mTaskInfo,
                    /* x= */ mResult.mCaptionX,
                    /* y= */ mResult.mCaptionY + mResult.mCaptionTopPadding,
                    /* x= */ taskBounds.left + mResult.mCaptionX,
                    /* y= */ taskBounds.top + mResult.mCaptionY + mResult.mCaptionTopPadding,
                    mDisplayController,
                    mRootTaskDisplayAreaOrganizer,
                    mContext,