@@ -22,6 +22,7 @@ static class Device {
22
22
int mDevice ;
23
23
Widget mPreviousWidget = null ;
24
24
Widget mTouchStartWidget = null ;
25
+ Widget mHoverStartWidget = null ;
25
26
boolean mWasPressed ;
26
27
long mDownTime ;
27
28
MotionEvent .PointerProperties mProperties [];
@@ -108,27 +109,37 @@ public static void dispatch(Widget aWidget, int aDevice, boolean aFocused, boole
108
109
}
109
110
generateEvent (device .mPreviousWidget , device , aFocused , MotionEvent .ACTION_HOVER_EXIT , true , device .mMouseOutCoords );
110
111
device .mPreviousWidget = null ;
112
+ device .mHoverStartWidget = null ;
111
113
}
112
114
if (aWidget == null ) {
113
115
device .mPreviousWidget = null ;
116
+ device .mHoverStartWidget = null ;
114
117
return ;
115
118
}
116
119
if (aWidget != device .mPreviousWidget && !aPressed ) {
117
120
generateEvent (aWidget , device , aFocused , MotionEvent .ACTION_HOVER_ENTER , true );
121
+ device .mHoverStartWidget = aWidget ;
118
122
}
119
123
if (aPressed && !device .mWasPressed ) {
120
124
device .mDownTime = SystemClock .uptimeMillis ();
121
125
device .mWasPressed = true ;
122
126
if (!isOtherDeviceDown (device .mDevice )) {
123
127
generateEvent (aWidget , device , aFocused , MotionEvent .ACTION_HOVER_EXIT , true );
124
128
generateEvent (aWidget , device , aFocused , MotionEvent .ACTION_DOWN , false );
129
+ device .mHoverStartWidget = null ;
130
+ }
131
+ for (int i =0 ; i <devices .size (); i ++) {
132
+ if (devices .get (i ) != device && devices .get (i ).mHoverStartWidget != null ) {
133
+ generateEvent (devices .get (i ).mHoverStartWidget , devices .get (i ), aFocused , MotionEvent .ACTION_HOVER_EXIT , true );
134
+ }
125
135
}
126
136
device .mTouchStartWidget = aWidget ;
127
137
} else if (!aPressed && device .mWasPressed ) {
128
138
device .mWasPressed = false ;
129
139
if (!isOtherDeviceDown (device .mDevice )) {
130
140
generateEvent (device .mTouchStartWidget , device , aFocused , MotionEvent .ACTION_UP , false );
131
141
generateEvent (aWidget , device , aFocused , MotionEvent .ACTION_HOVER_ENTER , true );
142
+ device .mHoverStartWidget = aWidget ;
132
143
}
133
144
device .mTouchStartWidget = null ;
134
145
} else if (moving && aPressed ) {
0 commit comments