fix touchmode in attachinfo

This commit is contained in:
houzh 2023-11-28 19:23:19 +08:00
parent c12f7a327e
commit 9aa34cbf2a

View File

@ -295,11 +295,11 @@ void WindowManager::onMotion(MotionEvent&event) {
auto w = (*itr);
ViewTreeObserver*obv = w->getViewTreeObserver();
if(event.getAction()==MotionEvent::ACTION_DOWN){
obv->dispatchOnTouchModeChanged(true);
w->mAttachInfo->mInTouchMode=true;
obv->dispatchOnTouchModeChanged(true);
}else if(event.getAction()==MotionEvent::ACTION_UP){
obv->dispatchOnTouchModeChanged(false);
w->mAttachInfo->mInTouchMode=false;
obv->dispatchOnTouchModeChanged(false);
}
if ((w->getVisibility()==View::VISIBLE) && w->getBound().contains(x,y)) {
event.offsetLocation(-w->getLeft(),-w->getTop());