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

Commit 02785fcd authored by Merissa Mitchell's avatar Merissa Mitchell Committed by Android (Google) Code Review
Browse files

Merge "[WindowDecor] Skip hover animation if task is not in focus." into main

parents 81c3df1b 63fa8e9d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -469,6 +469,14 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
            }
        }

        // If we get a relayout call while hovering over maximize button in the app header but the
        // task has lost focus, explicitly cancel the hover (since we don't get a HOVER_EXIT signal
        // in this case).
        if (!taskInfo.isFocused && mIsAppHeaderMaximizeButtonHovered) {
            setAppHeaderMaximizeButtonHovered(false);
            onMaximizeButtonHoverExit();
        }

        if (isHandleMenuActive()) {
            mHandleMenu.relayout(
                    startT,
@@ -2010,6 +2018,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
     */
    @Override
    public void onMaximizeButtonHoverEnter() {
        if (!mTaskInfo.isFocused) return;
        asAppHeader(mWindowDecorViewHolder).onMaximizeWindowHoverEnter();
    }

+8 −0
Original line number Diff line number Diff line
@@ -201,6 +201,14 @@ class AppHeaderController(
            traceTag = Trace.TRACE_TAG_WINDOW_MANAGER,
            name = "AppHeaderController#relayout",
        ) {
            // If we get a relayout call while hovering over maximize button in the app header but
            // the task has lost focus, explicitly cancel the hover (since we don't get a HOVER_EXIT
            // signal in this case).
            if (!taskInfo.isFocused && isAppHeaderMaximizeButtonHovered) {
                setAppHeaderMaximizeButtonHovered(hovered = false)
                onMaximizeButtonHoverExit()
            }

            val captionLayout =
                super.relayout(
                    params,
+1 −0
Original line number Diff line number Diff line
@@ -710,6 +710,7 @@ class AppHeaderViewHolder(
    }

    fun onMaximizeWindowHoverEnter() {
        if (!currentTaskInfo.isFocused) return
        maximizeButtonView.startHoverAnimation()
    }