mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-05 21:58:44 +08:00
fix touchmode in attachinfo
This commit is contained in:
parent
10ce6a3440
commit
c12f7a327e
@ -294,10 +294,13 @@ void WindowManager::onMotion(MotionEvent&event) {
|
||||
for (auto itr = mWindows.rbegin();itr != mWindows.rend();itr++) {
|
||||
auto w = (*itr);
|
||||
ViewTreeObserver*obv = w->getViewTreeObserver();
|
||||
if(event.getAction()==MotionEvent::ACTION_DOWN)
|
||||
if(event.getAction()==MotionEvent::ACTION_DOWN){
|
||||
obv->dispatchOnTouchModeChanged(true);
|
||||
else if(event.getAction()==MotionEvent::ACTION_UP)
|
||||
w->mAttachInfo->mInTouchMode=true;
|
||||
}else if(event.getAction()==MotionEvent::ACTION_UP){
|
||||
obv->dispatchOnTouchModeChanged(false);
|
||||
w->mAttachInfo->mInTouchMode=false;
|
||||
}
|
||||
if ((w->getVisibility()==View::VISIBLE) && w->getBound().contains(x,y)) {
|
||||
event.offsetLocation(-w->getLeft(),-w->getTop());
|
||||
w->dispatchTouchEvent(event);
|
||||
|
Loading…
Reference in New Issue
Block a user