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

Commit 728333dc authored by Maryam Dehaini's avatar Maryam Dehaini
Browse files

Transition to fullscreen based on position of motion event

The position of a task is calculated by subtracting the
position of the motion event relative to the task from the motion event
relative to the display. When a task is dragged quickly to the top to
transition into fullscreen, the difference becomes a large number that
is greater than the status bar height, so, the task does not transition
into fullscreen. This change uses the raw y of the motion event to check
if the task should transition to fullscreen.

Bug: 281907587
Test: Quickly drag task to the top of the screen to make sure it
transitions to freeform.

Change-Id: I3bf58b9e60e357a3d2349640639b711084e42f00
parent 1ae8e217
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -524,14 +524,16 @@ class DesktopTasksController(
     * Perform checks required on drag end. Move to fullscreen if drag ends in status bar area.
     *
     * @param taskInfo the task being dragged.
     * @param position position of surface when drag ends
     * @param position position of surface when drag ends.
     * @param y the Y position of the motion event.
     */
    fun onDragPositioningEnd(
            taskInfo: RunningTaskInfo,
            position: Point
            position: Point,
            y: Float
    ) {
        val statusBarHeight = getStatusBarHeight(taskInfo)
        if (position.y <= statusBarHeight && taskInfo.windowingMode == WINDOWING_MODE_FREEFORM) {
        if (y <= statusBarHeight && taskInfo.windowingMode == WINDOWING_MODE_FREEFORM) {
            moveToFullscreenWithAnimation(taskInfo, position)
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -405,7 +405,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
                    mDragPositioningCallback.onDragPositioningEnd(
                            e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx));
                    mDesktopTasksController.ifPresent(c -> c.onDragPositioningEnd(taskInfo,
                            position));
                            position, e.getRawY()));
                    final boolean wasDragging = mIsDragging;
                    mIsDragging = false;
                    return wasDragging;