summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mkspecs/features/android/spec_post.prf6
-rw-r--r--src/android/templates/build.gradle2
-rw-r--r--src/gui/kernel/qsimpledrag.cpp14
-rw-r--r--src/network/socket/qsocks5socketengine.cpp6
-rw-r--r--src/plugins/platforms/android/qandroidinputcontext.cpp30
5 files changed, 47 insertions, 11 deletions
diff --git a/mkspecs/features/android/spec_post.prf b/mkspecs/features/android/spec_post.prf
new file mode 100644
index 0000000000..4d11efb2cf
--- /dev/null
+++ b/mkspecs/features/android/spec_post.prf
@@ -0,0 +1,6 @@
+load(spec_post)
+
+# Work around idiosyncracy in Android NDK's make executable
+# which tries to call the shell-builtin "move" as direct process
+equals(QMAKE_HOST.os, Windows):equals(QMAKE_MOVE, move): \
+ QMAKE_MOVE = cmd /c move
diff --git a/src/android/templates/build.gradle b/src/android/templates/build.gradle
index 989d0792cf..ed704c4957 100644
--- a/src/android/templates/build.gradle
+++ b/src/android/templates/build.gradle
@@ -36,7 +36,7 @@ android {
compileSdkVersion androidCompileSdkVersion.toInteger()
- buildToolsVersion androidBuildToolsVersion
+ buildToolsVersion '28.0.3'
sourceSets {
main {
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index 9aab332ef5..bd409c124f 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -310,11 +310,15 @@ void QBasicDrag::updateCursor(Qt::DropAction action)
m_dndHasSetOverrideCursor = true;
} else {
QCursor *cursor = QGuiApplication::overrideCursor();
- if (!pixmap.isNull()) {
- if (cursor->pixmap().cacheKey() != pixmap.cacheKey())
- QGuiApplication::changeOverrideCursor(QCursor(pixmap));
- } else if (cursorShape != cursor->shape()) {
- QGuiApplication::changeOverrideCursor(QCursor(cursorShape));
+ if (!cursor) {
+ QGuiApplication::changeOverrideCursor(pixmap.isNull() ? QCursor(cursorShape) : QCursor(pixmap));
+ } else {
+ if (!pixmap.isNull()) {
+ if (cursor->pixmap().cacheKey() != pixmap.cacheKey())
+ QGuiApplication::changeOverrideCursor(QCursor(pixmap));
+ } else if (cursorShape != cursor->shape()) {
+ QGuiApplication::changeOverrideCursor(QCursor(cursorShape));
+ }
}
}
#endif
diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp
index 23aec12390..e6ffdc3ac5 100644
--- a/src/network/socket/qsocks5socketengine.cpp
+++ b/src/network/socket/qsocks5socketengine.cpp
@@ -1611,8 +1611,10 @@ qint64 QSocks5SocketEngine::readDatagram(char *data, qint64 maxlen, QIpPacketHea
QSocks5RevivedDatagram datagram = d->udpData->pendingDatagrams.dequeue();
int copyLen = qMin<int>(maxlen, datagram.data.size());
memcpy(data, datagram.data.constData(), copyLen);
- header->senderAddress = datagram.address;
- header->senderPort = datagram.port;
+ if (header) {
+ header->senderAddress = datagram.address;
+ header->senderPort = datagram.port;
+ }
return copyLen;
#else
Q_UNUSED(data)
diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp
index fa07af8c46..5614d3b04f 100644
--- a/src/plugins/platforms/android/qandroidinputcontext.cpp
+++ b/src/plugins/platforms/android/qandroidinputcontext.cpp
@@ -558,6 +558,7 @@ static inline int getBlockPosition(const QSharedPointer<QInputMethodQueryEvent>
void QAndroidInputContext::reset()
{
+ focusObjectStopComposing();
clear();
m_batchEditNestingLevel = 0;
m_handleMode = Hidden;
@@ -792,7 +793,25 @@ void QAndroidInputContext::touchDown(int x, int y)
m_handleMode = ShowCursor;
// The VK will appear in a moment, stop the timer
m_hideCursorHandleTimer.stop();
- focusObjectStopComposing();
+
+ if (focusObjectIsComposing()) {
+ const double pixelDensity =
+ QGuiApplication::focusWindow()
+ ? QHighDpiScaling::factor(QGuiApplication::focusWindow())
+ : QHighDpiScaling::factor(QtAndroid::androidPlatformIntegration()->screen());
+
+ const QPointF touchPointLocal =
+ QGuiApplication::inputMethod()->inputItemTransform().inverted().map(
+ QPointF(x / pixelDensity, y / pixelDensity));
+
+ const int curBlockPos = getBlockPosition(
+ focusObjectInputMethodQuery(Qt::ImCursorPosition | Qt::ImAbsolutePosition));
+ const int touchPosition = curBlockPos
+ + QInputMethod::queryFocusObject(Qt::ImCursorPosition, touchPointLocal).toInt();
+ if (touchPosition != m_composingCursor)
+ focusObjectStopComposing();
+ }
+
updateSelectionHandles();
}
}
@@ -1200,13 +1219,18 @@ jint QAndroidInputContext::getCursorCapsMode(jint /*reqModes*/)
const uint qtInputMethodHints = query->value(Qt::ImHints).toUInt();
const int localPos = query->value(Qt::ImCursorPosition).toInt();
- bool atWordBoundary = (localPos == 0);
+ bool atWordBoundary =
+ localPos == 0
+ && (!focusObjectIsComposing() || m_composingCursor == m_composingTextStart);
+
if (!atWordBoundary) {
QString surroundingText = query->value(Qt::ImSurroundingText).toString();
surroundingText.truncate(localPos);
+ if (focusObjectIsComposing())
+ surroundingText += m_composingText.leftRef(m_composingCursor - m_composingTextStart);
// Add a character to see if it is at the end of the sentence or not
QTextBoundaryFinder finder(QTextBoundaryFinder::Sentence, surroundingText + QLatin1Char('A'));
- finder.setPosition(localPos);
+ finder.setPosition(surroundingText.length());
if (finder.isAtBoundary())
atWordBoundary = finder.isAtBoundary();
}