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

Commit f8c274c9 authored by Ben Lin's avatar Ben Lin
Browse files

PiP: Do nothing when tapping on resize drag handle.

When tapping on a resize handle (but not actually have any movement), we
should not do any resize operation.

This also fixes an issue that used to check againt the relative x,y
coordinate fot hit test. It should be using the raw-x,y pointers
instead.

Bug: 158300205
Test: Tap on the corner, nothing happens
Change-Id: Ib01428664125734cd6e253c29902b0f5b080a72f
parent 2ea259c0
Loading
Loading
Loading
Loading
+18 −9
Original line number Diff line number Diff line
@@ -292,20 +292,29 @@ public class PipResizeGestureHandler {
                    break;
                case MotionEvent.ACTION_UP:
                case MotionEvent.ACTION_CANCEL:
                    mPipTaskOrganizer.scheduleFinishResizePip(mLastResizeBounds, (Rect bounds) -> {
                    if (!mLastResizeBounds.isEmpty()) {
                        mPipTaskOrganizer.scheduleFinishResizePip(mLastResizeBounds,
                                (Rect bounds) -> {
                                    new Handler(Looper.getMainLooper()).post(() -> {
                                        mMotionHelper.synchronizePinnedStackBounds();
                                        mUpdateMovementBoundsRunnable.run();
                            mCtrlType = CTRL_NONE;
                            mAllowGesture = false;
                            mThresholdCrossed = false;
                                        resetState();
                                    });
                                });
                    } else {
                        resetState();
                    }
                    break;
            }
        }
    }

    private void resetState() {
        mCtrlType = CTRL_NONE;
        mAllowGesture = false;
        mThresholdCrossed = false;
    }

    void updateMaxSize(int maxX, int maxY) {
        mMaxSize.set(maxX, maxY);
    }
+1 −3
Original line number Diff line number Diff line
@@ -605,11 +605,9 @@ public class PipTouchHandler {

        MotionEvent ev = (MotionEvent) inputEvent;


        if (mPipResizeGestureHandler.isWithinTouchRegion((int) ev.getX(), (int) ev.getY())) {
        if (mPipResizeGestureHandler.isWithinTouchRegion((int) ev.getRawX(), (int) ev.getRawY())) {
            return true;
        }

        if (mMagnetizedPip.maybeConsumeMotionEvent(ev)) {
            // If the first touch event occurs within the magnetic field, pass the ACTION_DOWN event
            // to the touch state. Touch state needs a DOWN event in order to later process MOVE