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

Commit 829ab6da authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev Committed by Android (Google) Code Review
Browse files

Merge "Zero out DragEvent position when it should not be available"

parents 6cfa1cc4 cc010b2a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1401,6 +1401,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                root.setDragFocus(target);

                final int action = event.mAction;
                // Position should not be available for ACTION_DRAG_ENTERED and ACTION_DRAG_EXITED.
                event.mX = 0;
                event.mY = 0;

                // If we've dragged off of a child view or this window, send it the EXITED message
                if (mCurrentDragView != null) {
                    final View view = mCurrentDragView;
@@ -1429,6 +1433,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                    }
                }
                event.mAction = action;  // restore the event's original state
                event.mX = tx;
                event.mY = ty;
            }

            // Dispatch the actual drag location notice, localized into its coordinates
+1 −1
Original line number Diff line number Diff line
@@ -402,7 +402,7 @@ class DragState {
                }
                // force DRAG_EXITED_EVENT if appropriate
                DragEvent evt = obtainDragEvent(mTargetWindow, DragEvent.ACTION_DRAG_EXITED,
                        x, y, null, null, null, null, false);
                        0, 0, null, null, null, null, false);
                mTargetWindow.mClient.dispatchDragEvent(evt);
                if (myPid != mTargetWindow.mSession.mPid) {
                    evt.recycle();