Revert "Release left button before showing the popup context menu"
This partially reverts commit5e8b16f0e4
. Releasing the mouse button synthetically made it impossible to use tap and hold gestures. When investigating, it seems that other changes have fixed the original issue that5e8b16f0e4
was meant to address, so this is no longer needed. [ChangeLog][Android] Fixed regression that made it impossible for an application to use the tap-and-hold gesture. Fixes: QTBUG-72408 Change-Id: I53f687d047a4ad0fdf3c8c96a00ed1b11d09f047 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
parent
ed7dd9a6ed
commit
d3398207d0
@ -195,20 +195,6 @@ namespace QtAndroidInput
|
||||
angleDelta);
|
||||
}
|
||||
|
||||
void releaseMouse(int x, int y)
|
||||
{
|
||||
m_ignoreMouseEvents = true;
|
||||
QPoint globalPos(x,y);
|
||||
QWindow *tlw = topLevelWindowAt(globalPos);
|
||||
QPoint localPos = tlw ? (globalPos-tlw->position()) : globalPos;
|
||||
|
||||
// Release left button
|
||||
QWindowSystemInterface::handleMouseEvent(tlw,
|
||||
localPos,
|
||||
globalPos,
|
||||
Qt::MouseButtons(Qt::NoButton));
|
||||
}
|
||||
|
||||
static void longPress(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint x, jint y)
|
||||
{
|
||||
QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext();
|
||||
|
@ -61,8 +61,6 @@ namespace QtAndroidInput
|
||||
void updateHandles(int handleCount, QPoint editMenuPos = QPoint(), uint32_t editButtons = 0, QPoint cursor = QPoint(), QPoint anchor = QPoint(), bool rtl = false);
|
||||
|
||||
bool registerNatives(JNIEnv *env);
|
||||
|
||||
void releaseMouse(int x, int y);
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -827,9 +827,6 @@ void QAndroidInputContext::longPress(int x, int y)
|
||||
|
||||
focusObjectStopComposing();
|
||||
|
||||
// Release left button, otherwise the following events will cancel the menu popup
|
||||
QtAndroidInput::releaseMouse(x, y);
|
||||
|
||||
const double pixelDensity =
|
||||
QGuiApplication::focusWindow()
|
||||
? QHighDpiScaling::factor(QGuiApplication::focusWindow())
|
||||
|
Loading…
Reference in New Issue
Block a user