summaryrefslogtreecommitdiffstats
path: root/src/android
diff options
context:
space:
mode:
authorVyacheslav Koscheev <v.koscheev@2gis.ru>2016-06-02 16:23:29 +0600
committerVyacheslav Koscheev <vok1980@gmail.com>2016-06-16 14:08:27 +0000
commit797cd4b7bc8e9864c2d569c110b61e49e15c80c2 (patch)
tree94ada570742dc9d27784350555e9044905753966 /src/android
parent5c2d30c19ee100705a52eaa693bd835069e2b80f (diff)
Android: Don't send tabletEvent when it's not supported
If QT_NO_TABLETEVENT defined, then there is no sense to create tablet events. Its better to create general touch events in this case. Task-number: QTBUG-53887 Change-Id: I2fabc2241158d54d6c39a2f6071ab874f7debd39 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/android')
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
index 14da281a76..e602a6deba 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -84,6 +84,7 @@ public class QtNative
private static final int m_moveThreshold = 0;
private static ClipboardManager m_clipboardManager = null;
private static Method m_checkSelfPermissionMethod = null;
+ private static Boolean m_tabletEventSupported = null;
private static ClassLoader m_classLoader = null;
public static ClassLoader classLoader()
@@ -343,6 +344,9 @@ public class QtNative
{
int pointerType = 0;
+ if (m_tabletEventSupported == null)
+ m_tabletEventSupported = isTabletEventSupported();
+
if (Build.VERSION.SDK_INT >= 14) {
switch (event.getToolType(0)) {
case MotionEvent.TOOL_TYPE_STYLUS:
@@ -355,7 +359,7 @@ public class QtNative
}
}
- if (pointerType != 0) {
+ if (m_tabletEventSupported && pointerType != 0) {
tabletEvent(id, event.getDeviceId(), event.getEventTime(), event.getAction(), pointerType,
event.getButtonState(), event.getX(), event.getY(), event.getPressure());
} else {
@@ -685,6 +689,7 @@ public class QtNative
// pointer methods
// tablet methods
+ public static native boolean isTabletEventSupported();
public static native void tabletEvent(int winId, int deviceId, long time, int action, int pointerType, int buttonState, float x, float y, float pressure);
// tablet methods