Loading core/java/android/view/View.java +6 −1 Original line number Diff line number Diff line Loading @@ -21584,7 +21584,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ public void setPointerIcon(PointerIcon pointerIcon) { mPointerIcon = pointerIcon; if (mAttachInfo == null) { if (mAttachInfo == null || mAttachInfo.mHandlingPointerEvent) { return; } try { Loading Loading @@ -22636,6 +22636,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ boolean mHighContrastText; /** * Set to true if a pointer event is currently being handled. */ boolean mHandlingPointerEvent; /** * Global to the view hierarchy used as a temporary for dealing with * x/y points in the transparent region computations. core/java/android/view/ViewRootImpl.java +18 −13 Original line number Diff line number Diff line Loading @@ -4311,6 +4311,24 @@ public final class ViewRootImpl implements ViewParent, private int processPointerEvent(QueuedInputEvent q) { final MotionEvent event = (MotionEvent)q.mEvent; mAttachInfo.mUnbufferedDispatchRequested = false; final View eventTarget = (event.isFromSource(InputDevice.SOURCE_MOUSE) && mCapturingView != null) ? mCapturingView : mView; mAttachInfo.mHandlingPointerEvent = true; boolean handled = eventTarget.dispatchPointerEvent(event); maybeUpdatePointerIcon(event); mAttachInfo.mHandlingPointerEvent = false; if (mAttachInfo.mUnbufferedDispatchRequested && !mUnbufferedInputDispatch) { mUnbufferedInputDispatch = true; if (mConsumeBatchedInputScheduled) { scheduleConsumeBatchedInputImmediately(); } } return handled ? FINISH_HANDLED : FORWARD; } private void maybeUpdatePointerIcon(MotionEvent event) { if (event.getPointerCount() == 1 && event.isFromSource(InputDevice.SOURCE_MOUSE)) { if (event.getActionMasked() == MotionEvent.ACTION_HOVER_ENTER Loading @@ -4327,19 +4345,6 @@ public final class ViewRootImpl implements ViewParent, } } } mAttachInfo.mUnbufferedDispatchRequested = false; final View eventTarget = (event.isFromSource(InputDevice.SOURCE_MOUSE) && mCapturingView != null) ? mCapturingView : mView; boolean handled = eventTarget.dispatchPointerEvent(event); if (mAttachInfo.mUnbufferedDispatchRequested && !mUnbufferedInputDispatch) { mUnbufferedInputDispatch = true; if (mConsumeBatchedInputScheduled) { scheduleConsumeBatchedInputImmediately(); } } return handled ? FINISH_HANDLED : FORWARD; } private int processTrackballEvent(QueuedInputEvent q) { Loading Loading
core/java/android/view/View.java +6 −1 Original line number Diff line number Diff line Loading @@ -21584,7 +21584,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ public void setPointerIcon(PointerIcon pointerIcon) { mPointerIcon = pointerIcon; if (mAttachInfo == null) { if (mAttachInfo == null || mAttachInfo.mHandlingPointerEvent) { return; } try { Loading Loading @@ -22636,6 +22636,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ boolean mHighContrastText; /** * Set to true if a pointer event is currently being handled. */ boolean mHandlingPointerEvent; /** * Global to the view hierarchy used as a temporary for dealing with * x/y points in the transparent region computations.
core/java/android/view/ViewRootImpl.java +18 −13 Original line number Diff line number Diff line Loading @@ -4311,6 +4311,24 @@ public final class ViewRootImpl implements ViewParent, private int processPointerEvent(QueuedInputEvent q) { final MotionEvent event = (MotionEvent)q.mEvent; mAttachInfo.mUnbufferedDispatchRequested = false; final View eventTarget = (event.isFromSource(InputDevice.SOURCE_MOUSE) && mCapturingView != null) ? mCapturingView : mView; mAttachInfo.mHandlingPointerEvent = true; boolean handled = eventTarget.dispatchPointerEvent(event); maybeUpdatePointerIcon(event); mAttachInfo.mHandlingPointerEvent = false; if (mAttachInfo.mUnbufferedDispatchRequested && !mUnbufferedInputDispatch) { mUnbufferedInputDispatch = true; if (mConsumeBatchedInputScheduled) { scheduleConsumeBatchedInputImmediately(); } } return handled ? FINISH_HANDLED : FORWARD; } private void maybeUpdatePointerIcon(MotionEvent event) { if (event.getPointerCount() == 1 && event.isFromSource(InputDevice.SOURCE_MOUSE)) { if (event.getActionMasked() == MotionEvent.ACTION_HOVER_ENTER Loading @@ -4327,19 +4345,6 @@ public final class ViewRootImpl implements ViewParent, } } } mAttachInfo.mUnbufferedDispatchRequested = false; final View eventTarget = (event.isFromSource(InputDevice.SOURCE_MOUSE) && mCapturingView != null) ? mCapturingView : mView; boolean handled = eventTarget.dispatchPointerEvent(event); if (mAttachInfo.mUnbufferedDispatchRequested && !mUnbufferedInputDispatch) { mUnbufferedInputDispatch = true; if (mConsumeBatchedInputScheduled) { scheduleConsumeBatchedInputImmediately(); } } return handled ? FINISH_HANDLED : FORWARD; } private int processTrackballEvent(QueuedInputEvent q) { Loading