Stop unconditional synth of mouse events on Android

Before this patch we always send mouse events for each
touch event that happens.
This is redundant (we already synthesize in
QGuiApplicatioin) and breaks some touch handling
in QtQuick2.

Change-Id: I4bc1686a7a46039901315619a0acdf2888ad6775
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This commit is contained in:
Frederik Gladhorn 2013-07-26 18:25:44 +02:00 committed by The Qt Project
parent 591584d9a9
commit 32e6778bda

View File

@ -343,28 +343,6 @@ public class QtNative
touchEnd(id,1);
}
//@ANDROID-5
switch (event.getAction()) {
case MotionEvent.ACTION_UP:
mouseUp(id,(int) event.getX(), (int) event.getY());
break;
case MotionEvent.ACTION_DOWN:
mouseDown(id,(int) event.getX(), (int) event.getY());
m_oldx = (int) event.getX();
m_oldy = (int) event.getY();
break;
case MotionEvent.ACTION_MOVE:
int dx = (int) (event.getX() - m_oldx);
int dy = (int) (event.getY() - m_oldy);
if (Math.abs(dx) > m_moveThreshold || Math.abs(dy) > m_moveThreshold) {
mouseMove(id, (int) event.getX(), (int) event.getY());
m_oldx = (int) event.getX();
m_oldy = (int) event.getY();
}
break;
}
}
static public void sendTrackballEvent(MotionEvent event, int id)