Android: use logging category for im debug
Change-Id: I78e84313841f83416dee6b6b2970b402acce5060 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit b992aabd89a150fbb32feb7508cfcaad95fe486a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
10950d87f7
commit
b2222ec0d3
@ -17,6 +17,8 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
Q_LOGGING_CATEGORY(lcQpaInputMethods, "qt.qpa.input.methods");
|
||||||
|
|
||||||
using namespace QtAndroid;
|
using namespace QtAndroid;
|
||||||
|
|
||||||
namespace QtAndroidInput
|
namespace QtAndroidInput
|
||||||
@ -30,9 +32,7 @@ namespace QtAndroidInput
|
|||||||
|
|
||||||
void updateSelection(int selStart, int selEnd, int candidatesStart, int candidatesEnd)
|
void updateSelection(int selStart, int selEnd, int candidatesStart, int candidatesEnd)
|
||||||
{
|
{
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << ">>> UPDATESELECTION" << selStart << selEnd << candidatesStart << candidatesEnd;
|
||||||
qDebug() << ">>> UPDATESELECTION" << selStart << selEnd << candidatesStart << candidatesEnd;
|
|
||||||
#endif
|
|
||||||
QJniObject::callStaticMethod<void>(applicationClass(),
|
QJniObject::callStaticMethod<void>(applicationClass(),
|
||||||
"updateSelection",
|
"updateSelection",
|
||||||
"(IIII)V",
|
"(IIII)V",
|
||||||
@ -53,25 +53,19 @@ namespace QtAndroidInput
|
|||||||
height,
|
height,
|
||||||
inputHints,
|
inputHints,
|
||||||
enterKeyType);
|
enterKeyType);
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ SHOWSOFTWAREKEYBOARD" << left << top << width << height << inputHints << enterKeyType;
|
||||||
qDebug() << "@@@ SHOWSOFTWAREKEYBOARD" << left << top << width << height << inputHints << enterKeyType;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void resetSoftwareKeyboard()
|
void resetSoftwareKeyboard()
|
||||||
{
|
{
|
||||||
QJniObject::callStaticMethod<void>(applicationClass(), "resetSoftwareKeyboard");
|
QJniObject::callStaticMethod<void>(applicationClass(), "resetSoftwareKeyboard");
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ RESETSOFTWAREKEYBOARD";
|
||||||
qDebug("@@@ RESETSOFTWAREKEYBOARD");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void hideSoftwareKeyboard()
|
void hideSoftwareKeyboard()
|
||||||
{
|
{
|
||||||
QJniObject::callStaticMethod<void>(applicationClass(), "hideSoftwareKeyboard");
|
QJniObject::callStaticMethod<void>(applicationClass(), "hideSoftwareKeyboard");
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ HIDESOFTWAREKEYBOARD";
|
||||||
qDebug("@@@ HIDESOFTWAREKEYBOARD");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSoftwareKeyboardVisible()
|
bool isSoftwareKeyboardVisible()
|
||||||
@ -329,9 +323,7 @@ namespace QtAndroidInput
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_STYLUS
|
qCDebug(lcQpaInputMethods) << action << pointerType << buttonState << '@' << x << y << "pressure" << pressure << ": buttons" << buttons;
|
||||||
qDebug() << action << pointerType << buttonState << '@' << x << y << "pressure" << pressure << ": buttons" << buttons;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QWindowSystemInterface::handleTabletEvent(tlw, ulong(time),
|
QWindowSystemInterface::handleTabletEvent(tlw, ulong(time),
|
||||||
localPos, globalPosF, int(QInputDevice::DeviceType::Stylus), pointerType,
|
localPos, globalPosF, int(QInputDevice::DeviceType::Stylus), pointerType,
|
||||||
@ -797,9 +789,7 @@ namespace QtAndroidInput
|
|||||||
QMetaObject::invokeMethod(inputContext, "hideSelectionHandles", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(inputContext, "hideSelectionHandles", Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ KEYBOARDVISIBILITYCHANGED" << inputContext;
|
||||||
qDebug() << "@@@ KEYBOARDVISIBILITYCHANGED" << inputContext;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void keyboardGeometryChanged(JNIEnv */*env*/, jobject /*thiz*/, jint x, jint y, jint w, jint h)
|
static void keyboardGeometryChanged(JNIEnv */*env*/, jobject /*thiz*/, jint x, jint y, jint w, jint h)
|
||||||
@ -812,16 +802,12 @@ namespace QtAndroidInput
|
|||||||
if (inputContext && qGuiApp)
|
if (inputContext && qGuiApp)
|
||||||
inputContext->emitKeyboardRectChanged();
|
inputContext->emitKeyboardRectChanged();
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ KEYBOARDRECTCHANGED" << m_softwareKeyboardRect;
|
||||||
qDebug() << "@@@ KEYBOARDRECTCHANGED" << m_softwareKeyboardRect;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handleLocationChanged(JNIEnv */*env*/, jobject /*thiz*/, int id, int x, int y)
|
static void handleLocationChanged(JNIEnv */*env*/, jobject /*thiz*/, int id, int x, int y)
|
||||||
{
|
{
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ handleLocationChanged" << id << x << y;
|
||||||
qDebug() << "@@@ handleLocationChanged" << id << x << y;
|
|
||||||
#endif
|
|
||||||
QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext();
|
QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext();
|
||||||
if (inputContext && qGuiApp)
|
if (inputContext && qGuiApp)
|
||||||
QMetaObject::invokeMethod(inputContext, "handleLocationChanged", Qt::BlockingQueuedConnection,
|
QMetaObject::invokeMethod(inputContext, "handleLocationChanged", Qt::BlockingQueuedConnection,
|
||||||
|
@ -6,10 +6,13 @@
|
|||||||
|
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
#include <QtCore/qglobal.h>
|
#include <QtCore/qglobal.h>
|
||||||
|
#include <QtCore/QLoggingCategory>
|
||||||
#include <QtCore/QRect>
|
#include <QtCore/QRect>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
Q_DECLARE_LOGGING_CATEGORY(lcQpaInputMethods);
|
||||||
|
|
||||||
namespace QtAndroidInput
|
namespace QtAndroidInput
|
||||||
{
|
{
|
||||||
// Software keyboard support
|
// Software keyboard support
|
||||||
|
@ -80,9 +80,7 @@ static jboolean beginBatchEdit(JNIEnv */*env*/, jobject /*thiz*/)
|
|||||||
if (!m_androidInputContext)
|
if (!m_androidInputContext)
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ BEGINBATCH";
|
||||||
qDebug("@@@ BEGINBATCH");
|
|
||||||
#endif
|
|
||||||
jboolean res = JNI_FALSE;
|
jboolean res = JNI_FALSE;
|
||||||
runOnQtThread([&res]{res = m_androidInputContext->beginBatchEdit();});
|
runOnQtThread([&res]{res = m_androidInputContext->beginBatchEdit();});
|
||||||
return res;
|
return res;
|
||||||
@ -93,9 +91,7 @@ static jboolean endBatchEdit(JNIEnv */*env*/, jobject /*thiz*/)
|
|||||||
if (!m_androidInputContext)
|
if (!m_androidInputContext)
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ ENDBATCH";
|
||||||
qDebug("@@@ ENDBATCH");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
jboolean res = JNI_FALSE;
|
jboolean res = JNI_FALSE;
|
||||||
runOnQtThread([&res]{res = m_androidInputContext->endBatchEdit();});
|
runOnQtThread([&res]{res = m_androidInputContext->endBatchEdit();});
|
||||||
@ -113,9 +109,7 @@ static jboolean commitText(JNIEnv *env, jobject /*thiz*/, jstring text, jint new
|
|||||||
QString str(reinterpret_cast<const QChar *>(jstr), env->GetStringLength(text));
|
QString str(reinterpret_cast<const QChar *>(jstr), env->GetStringLength(text));
|
||||||
env->ReleaseStringChars(text, jstr);
|
env->ReleaseStringChars(text, jstr);
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ COMMIT" << str << newCursorPosition;
|
||||||
qDebug() << "@@@ COMMIT" << str << newCursorPosition;
|
|
||||||
#endif
|
|
||||||
jboolean res = JNI_FALSE;
|
jboolean res = JNI_FALSE;
|
||||||
runOnQtThread([&]{res = m_androidInputContext->commitText(str, newCursorPosition);});
|
runOnQtThread([&]{res = m_androidInputContext->commitText(str, newCursorPosition);});
|
||||||
return res;
|
return res;
|
||||||
@ -126,9 +120,7 @@ static jboolean deleteSurroundingText(JNIEnv */*env*/, jobject /*thiz*/, jint le
|
|||||||
if (!m_androidInputContext)
|
if (!m_androidInputContext)
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ DELETE" << leftLength << rightLength;
|
||||||
qDebug() << "@@@ DELETE" << leftLength << rightLength;
|
|
||||||
#endif
|
|
||||||
jboolean res = JNI_FALSE;
|
jboolean res = JNI_FALSE;
|
||||||
runOnQtThread([&]{res = m_androidInputContext->deleteSurroundingText(leftLength, rightLength);});
|
runOnQtThread([&]{res = m_androidInputContext->deleteSurroundingText(leftLength, rightLength);});
|
||||||
return res;
|
return res;
|
||||||
@ -139,9 +131,7 @@ static jboolean finishComposingText(JNIEnv */*env*/, jobject /*thiz*/)
|
|||||||
if (!m_androidInputContext)
|
if (!m_androidInputContext)
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ FINISH";
|
||||||
qDebug("@@@ FINISH");
|
|
||||||
#endif
|
|
||||||
jboolean res = JNI_FALSE;
|
jboolean res = JNI_FALSE;
|
||||||
runOnQtThread([&]{res = m_androidInputContext->finishComposingText();});
|
runOnQtThread([&]{res = m_androidInputContext->finishComposingText();});
|
||||||
return res;
|
return res;
|
||||||
@ -165,9 +155,7 @@ static jobject getExtractedText(JNIEnv *env, jobject /*thiz*/, int hintMaxChars,
|
|||||||
QAndroidInputContext::ExtractedText extractedText;
|
QAndroidInputContext::ExtractedText extractedText;
|
||||||
runOnQtThread([&]{extractedText = m_androidInputContext->getExtractedText(hintMaxChars, hintMaxLines, flags);});
|
runOnQtThread([&]{extractedText = m_androidInputContext->getExtractedText(hintMaxChars, hintMaxLines, flags);});
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ GETEX" << hintMaxChars << hintMaxLines << QString::fromLatin1("0x") + QString::number(flags,16) << extractedText.text << "partOff:" << extractedText.partialStartOffset << extractedText.partialEndOffset << "sel:" << extractedText.selectionStart << extractedText.selectionEnd << "offset:" << extractedText.startOffset;
|
||||||
qDebug() << "@@@ GETEX" << hintMaxChars << hintMaxLines << QString::fromLatin1("0x") + QString::number(flags,16) << extractedText.text << "partOff:" << extractedText.partialStartOffset << extractedText.partialEndOffset << "sel:" << extractedText.selectionStart << extractedText.selectionEnd << "offset:" << extractedText.startOffset;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
jobject object = env->NewObject(m_extractedTextClass, m_classConstructorMethodID);
|
jobject object = env->NewObject(m_extractedTextClass, m_classConstructorMethodID);
|
||||||
env->SetIntField(object, m_partialStartOffsetFieldID, extractedText.partialStartOffset);
|
env->SetIntField(object, m_partialStartOffsetFieldID, extractedText.partialStartOffset);
|
||||||
@ -190,9 +178,7 @@ static jstring getSelectedText(JNIEnv *env, jobject /*thiz*/, jint flags)
|
|||||||
|
|
||||||
QString text;
|
QString text;
|
||||||
runOnQtThread([&]{text = m_androidInputContext->getSelectedText(flags);});
|
runOnQtThread([&]{text = m_androidInputContext->getSelectedText(flags);});
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ GETSEL" << text;
|
||||||
qDebug() << "@@@ GETSEL" << text;
|
|
||||||
#endif
|
|
||||||
if (text.isEmpty())
|
if (text.isEmpty())
|
||||||
return 0;
|
return 0;
|
||||||
return env->NewString(reinterpret_cast<const jchar *>(text.constData()), jsize(text.length()));
|
return env->NewString(reinterpret_cast<const jchar *>(text.constData()), jsize(text.length()));
|
||||||
@ -205,9 +191,7 @@ static jstring getTextAfterCursor(JNIEnv *env, jobject /*thiz*/, jint length, ji
|
|||||||
|
|
||||||
QString text;
|
QString text;
|
||||||
runOnQtThread([&]{text = m_androidInputContext->getTextAfterCursor(length, flags);});
|
runOnQtThread([&]{text = m_androidInputContext->getTextAfterCursor(length, flags);});
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ GETA" << length << text;
|
||||||
qDebug() << "@@@ GETA" << length << text;
|
|
||||||
#endif
|
|
||||||
return env->NewString(reinterpret_cast<const jchar *>(text.constData()), jsize(text.length()));
|
return env->NewString(reinterpret_cast<const jchar *>(text.constData()), jsize(text.length()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,9 +202,7 @@ static jstring getTextBeforeCursor(JNIEnv *env, jobject /*thiz*/, jint length, j
|
|||||||
|
|
||||||
QString text;
|
QString text;
|
||||||
runOnQtThread([&]{text = m_androidInputContext->getTextBeforeCursor(length, flags);});
|
runOnQtThread([&]{text = m_androidInputContext->getTextBeforeCursor(length, flags);});
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ GETB" << length << text;
|
||||||
qDebug() << "@@@ GETB" << length << text;
|
|
||||||
#endif
|
|
||||||
return env->NewString(reinterpret_cast<const jchar *>(text.constData()), jsize(text.length()));
|
return env->NewString(reinterpret_cast<const jchar *>(text.constData()), jsize(text.length()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,9 +216,7 @@ static jboolean setComposingText(JNIEnv *env, jobject /*thiz*/, jstring text, ji
|
|||||||
QString str(reinterpret_cast<const QChar *>(jstr), env->GetStringLength(text));
|
QString str(reinterpret_cast<const QChar *>(jstr), env->GetStringLength(text));
|
||||||
env->ReleaseStringChars(text, jstr);
|
env->ReleaseStringChars(text, jstr);
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ SET" << str << newCursorPosition;
|
||||||
qDebug() << "@@@ SET" << str << newCursorPosition;
|
|
||||||
#endif
|
|
||||||
jboolean res = JNI_FALSE;
|
jboolean res = JNI_FALSE;
|
||||||
runOnQtThread([&]{res = m_androidInputContext->setComposingText(str, newCursorPosition);});
|
runOnQtThread([&]{res = m_androidInputContext->setComposingText(str, newCursorPosition);});
|
||||||
return res;
|
return res;
|
||||||
@ -247,9 +227,7 @@ static jboolean setComposingRegion(JNIEnv */*env*/, jobject /*thiz*/, jint start
|
|||||||
if (!m_androidInputContext)
|
if (!m_androidInputContext)
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ SETR" << start << end;
|
||||||
qDebug() << "@@@ SETR" << start << end;
|
|
||||||
#endif
|
|
||||||
jboolean res = JNI_FALSE;
|
jboolean res = JNI_FALSE;
|
||||||
runOnQtThread([&]{res = m_androidInputContext->setComposingRegion(start, end);});
|
runOnQtThread([&]{res = m_androidInputContext->setComposingRegion(start, end);});
|
||||||
return res;
|
return res;
|
||||||
@ -261,9 +239,7 @@ static jboolean setSelection(JNIEnv */*env*/, jobject /*thiz*/, jint start, jint
|
|||||||
if (!m_androidInputContext)
|
if (!m_androidInputContext)
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ SETSEL" << start << end;
|
||||||
qDebug() << "@@@ SETSEL" << start << end;
|
|
||||||
#endif
|
|
||||||
jboolean res = JNI_FALSE;
|
jboolean res = JNI_FALSE;
|
||||||
runOnQtThread([&]{res = m_androidInputContext->setSelection(start, end);});
|
runOnQtThread([&]{res = m_androidInputContext->setSelection(start, end);});
|
||||||
return res;
|
return res;
|
||||||
@ -275,9 +251,7 @@ static jboolean selectAll(JNIEnv */*env*/, jobject /*thiz*/)
|
|||||||
if (!m_androidInputContext)
|
if (!m_androidInputContext)
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ SELALL";
|
||||||
qDebug("@@@ SELALL");
|
|
||||||
#endif
|
|
||||||
jboolean res = JNI_FALSE;
|
jboolean res = JNI_FALSE;
|
||||||
runOnQtThread([&]{res = m_androidInputContext->selectAll();});
|
runOnQtThread([&]{res = m_androidInputContext->selectAll();});
|
||||||
return res;
|
return res;
|
||||||
@ -288,9 +262,7 @@ static jboolean cut(JNIEnv */*env*/, jobject /*thiz*/)
|
|||||||
if (!m_androidInputContext)
|
if (!m_androidInputContext)
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@";
|
||||||
qDebug("@@@");
|
|
||||||
#endif
|
|
||||||
jboolean res = JNI_FALSE;
|
jboolean res = JNI_FALSE;
|
||||||
runOnQtThread([&]{res = m_androidInputContext->cut();});
|
runOnQtThread([&]{res = m_androidInputContext->cut();});
|
||||||
return res;
|
return res;
|
||||||
@ -301,9 +273,7 @@ static jboolean copy(JNIEnv */*env*/, jobject /*thiz*/)
|
|||||||
if (!m_androidInputContext)
|
if (!m_androidInputContext)
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@";
|
||||||
qDebug("@@@");
|
|
||||||
#endif
|
|
||||||
jboolean res = JNI_FALSE;
|
jboolean res = JNI_FALSE;
|
||||||
runOnQtThread([&]{res = m_androidInputContext->copy();});
|
runOnQtThread([&]{res = m_androidInputContext->copy();});
|
||||||
return res;
|
return res;
|
||||||
@ -314,9 +284,7 @@ static jboolean copyURL(JNIEnv */*env*/, jobject /*thiz*/)
|
|||||||
if (!m_androidInputContext)
|
if (!m_androidInputContext)
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@";
|
||||||
qDebug("@@@");
|
|
||||||
#endif
|
|
||||||
jboolean res = JNI_FALSE;
|
jboolean res = JNI_FALSE;
|
||||||
runOnQtThread([&]{res = m_androidInputContext->copyURL();});
|
runOnQtThread([&]{res = m_androidInputContext->copyURL();});
|
||||||
return res;
|
return res;
|
||||||
@ -327,9 +295,7 @@ static jboolean paste(JNIEnv */*env*/, jobject /*thiz*/)
|
|||||||
if (!m_androidInputContext)
|
if (!m_androidInputContext)
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ PASTE";
|
||||||
qDebug("@@@ PASTE");
|
|
||||||
#endif
|
|
||||||
jboolean res = JNI_FALSE;
|
jboolean res = JNI_FALSE;
|
||||||
runOnQtThread([&]{res = m_androidInputContext->paste();});
|
runOnQtThread([&]{res = m_androidInputContext->paste();});
|
||||||
return res;
|
return res;
|
||||||
@ -340,9 +306,7 @@ static jboolean updateCursorPosition(JNIEnv */*env*/, jobject /*thiz*/)
|
|||||||
if (!m_androidInputContext)
|
if (!m_androidInputContext)
|
||||||
return JNI_FALSE;
|
return JNI_FALSE;
|
||||||
|
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "@@@ UPDATECURSORPOS";
|
||||||
qDebug("@@@ UPDATECURSORPOS");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
runOnQtThread([&]{m_androidInputContext->updateCursorPosition();});
|
runOnQtThread([&]{m_androidInputContext->updateCursorPosition();});
|
||||||
return true;
|
return true;
|
||||||
@ -1534,9 +1498,7 @@ jboolean QAndroidInputContext::setComposingRegion(jint start, jint end)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (start < textOffset || end - textOffset > text.length()) {
|
if (start < textOffset || end - textOffset > text.length()) {
|
||||||
#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL
|
qCDebug(lcQpaInputMethods) << "Warning: setComposingRegion: failed to retrieve text from composing region";
|
||||||
qWarning("setComposingRegion: failed to retrieve text from composing region");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return JNI_TRUE;
|
return JNI_TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user