diff options
author | Liang Qi <liang.qi@qt.io> | 2017-05-07 13:07:34 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-05-07 13:08:18 +0200 |
commit | d1ea4813458b383e66ce4df69d1833b8b6a279c4 (patch) | |
tree | 3bdc16da993e5de56b669e6774fb0748075ddd90 /src/plugins/platforms | |
parent | 1c87d4e1a1d0e1972f6dc85e55ea9be8a42797ba (diff) | |
parent | 0b1ec78c2d4871afcc89d5b046926b88f0819a7c (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
src/network/access/qnetworkreply.cpp
tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp
Change-Id: Iadf766269454087e69fb216fc3857d85b0ddfaad
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/android/androidjniclipboard.cpp | 23 | ||||
-rw-r--r-- | src/plugins/platforms/android/androidjniclipboard.h | 5 | ||||
-rw-r--r-- | src/plugins/platforms/android/qandroidplatformclipboard.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 2 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.h | 6 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 36 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/api/qeglfscursor.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/api/qeglfsintegration.cpp | 5 | ||||
-rw-r--r-- | src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp | 5 | ||||
-rw-r--r-- | src/plugins/platforms/vnc/qvncscreen.cpp | 4 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowscontext.cpp | 5 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowsinputcontext.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/winrt/qwinrtscreen.cpp | 33 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 11 |
14 files changed, 78 insertions, 63 deletions
diff --git a/src/plugins/platforms/android/androidjniclipboard.cpp b/src/plugins/platforms/android/androidjniclipboard.cpp index 17ff0e0bbb..833996403c 100644 --- a/src/plugins/platforms/android/androidjniclipboard.cpp +++ b/src/plugins/platforms/android/androidjniclipboard.cpp @@ -38,7 +38,6 @@ ****************************************************************************/ #include "androidjniclipboard.h" -#include "androidjnimain.h" #include <QtCore/private/qjni_p.h> QT_BEGIN_NAMESPACE @@ -46,10 +45,23 @@ QT_BEGIN_NAMESPACE using namespace QtAndroid; namespace QtAndroidClipboard { - void setClipboardListener(QAndroidPlatformClipboard *listener) + QAndroidPlatformClipboard *m_manager = nullptr; + + static char const *const QtNativeClassName = "org/qtproject/qt5/android/QtNative"; + static JNINativeMethod methods[] = { + {"onClipboardDataChanged", "()V", (void *)onClipboardDataChanged} + }; + + void setClipboardManager(QAndroidPlatformClipboard *manager) { - Q_UNUSED(listener); + m_manager = manager; QJNIObjectPrivate::callStaticMethod<void>(applicationClass(), "registerClipboardManager"); + jclass appClass = QtAndroid::applicationClass(); + QJNIEnvironmentPrivate env; + if (env->RegisterNatives(appClass, methods, sizeof(methods) / sizeof(methods[0])) < 0) { + __android_log_print(ANDROID_LOG_FATAL,"Qt", "RegisterNatives failed"); + return; + } } void setClipboardText(const QString &text) @@ -73,6 +85,11 @@ namespace QtAndroidClipboard "()Ljava/lang/String;"); return text.toString(); } + + void onClipboardDataChanged(JNIEnv */*env*/, jobject /*thiz*/) + { + m_manager->emitChanged(QClipboard::Clipboard); + } } QT_END_NAMESPACE diff --git a/src/plugins/platforms/android/androidjniclipboard.h b/src/plugins/platforms/android/androidjniclipboard.h index 9de6dc1f44..2ec566e729 100644 --- a/src/plugins/platforms/android/androidjniclipboard.h +++ b/src/plugins/platforms/android/androidjniclipboard.h @@ -41,6 +41,8 @@ #define ANDROIDJNICLIPBOARD_H #include <QString> +#include "qandroidplatformclipboard.h" +#include "androidjnimain.h" QT_BEGIN_NAMESPACE @@ -48,10 +50,11 @@ class QAndroidPlatformClipboard; namespace QtAndroidClipboard { // Clipboard support - void setClipboardListener(QAndroidPlatformClipboard *listener); + void setClipboardManager(QAndroidPlatformClipboard *manager); void setClipboardText(const QString &text); bool hasClipboardText(); QString clipboardText(); + void onClipboardDataChanged(JNIEnv */*env*/, jobject /*thiz*/); // Clipboard support } diff --git a/src/plugins/platforms/android/qandroidplatformclipboard.cpp b/src/plugins/platforms/android/qandroidplatformclipboard.cpp index a2bc802680..dc5147b259 100644 --- a/src/plugins/platforms/android/qandroidplatformclipboard.cpp +++ b/src/plugins/platforms/android/qandroidplatformclipboard.cpp @@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE QAndroidPlatformClipboard::QAndroidPlatformClipboard() { - QtAndroidClipboard::setClipboardListener(this); + QtAndroidClipboard::setClipboardManager(this); } QMimeData *QAndroidPlatformClipboard::mimeData(QClipboard::Mode mode) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index cfa7541dfa..b6c64d4d10 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1556,6 +1556,8 @@ void QCocoaWindow::foreachChildNSWindow(void (^block)(QCocoaWindow *)) */ void QCocoaWindow::recreateWindowIfNeeded() { + QMacAutoReleasePool pool; + QPlatformWindow *parentWindow = QPlatformWindow::parent(); qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::recreateWindowIfNeeded" << window() << "parent" << (parentWindow ? parentWindow->window() : 0); diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index 75a508370f..a78151ebbe 100644 --- a/src/plugins/platforms/cocoa/qnsview.h +++ b/src/plugins/platforms/cocoa/qnsview.h @@ -116,9 +116,9 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper)); - (void)resetMouseButtons; - (void)handleMouseEvent:(NSEvent *)theEvent; -- (bool)handleMouseDownEvent:(NSEvent *)theEvent; -- (bool)handleMouseDraggedEvent:(NSEvent *)theEvent; -- (bool)handleMouseUpEvent:(NSEvent *)theEvent; +- (bool)handleMouseDownEvent:(NSEvent *)theEvent withButton:(int)buttonNumber; +- (bool)handleMouseDraggedEvent:(NSEvent *)theEvent withButton:(int)buttonNumber; +- (bool)handleMouseUpEvent:(NSEvent *)theEvent withButton:(int)buttonNumber; - (void)mouseDown:(NSEvent *)theEvent; - (void)mouseDragged:(NSEvent *)theEvent; - (void)mouseUp:(NSEvent *)theEvent; diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index bbdf9ad44f..1e4ccc96a7 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -724,12 +724,12 @@ static bool _q_dontOverrideCtrlLMB = false; QWindowSystemInterface::handleFrameStrutMouseEvent(m_platformWindow->window(), timestamp, qtWindowPoint, qtScreenPoint, m_frameStrutButtons); } -- (bool)handleMouseDownEvent:(NSEvent *)theEvent +- (bool)handleMouseDownEvent:(NSEvent *)theEvent withButton:(int)buttonNumber { if ([self isTransparentForUserInput]) return false; - Qt::MouseButton button = cocoaButton2QtButton([theEvent buttonNumber]); + Qt::MouseButton button = cocoaButton2QtButton(buttonNumber); QPointF qtWindowPoint; QPointF qtScreenPoint; @@ -753,12 +753,12 @@ static bool _q_dontOverrideCtrlLMB = false; return true; } -- (bool)handleMouseDraggedEvent:(NSEvent *)theEvent +- (bool)handleMouseDraggedEvent:(NSEvent *)theEvent withButton:(int)buttonNumber { if ([self isTransparentForUserInput]) return false; - Qt::MouseButton button = cocoaButton2QtButton([theEvent buttonNumber]); + Qt::MouseButton button = cocoaButton2QtButton(buttonNumber); // Forward the event to the next responder if Qt did not accept the // corresponding mouse down for this button @@ -769,12 +769,12 @@ static bool _q_dontOverrideCtrlLMB = false; return true; } -- (bool)handleMouseUpEvent:(NSEvent *)theEvent +- (bool)handleMouseUpEvent:(NSEvent *)theEvent withButton:(int)buttonNumber { if ([self isTransparentForUserInput]) return false; - Qt::MouseButton button = cocoaButton2QtButton([theEvent buttonNumber]); + Qt::MouseButton button = cocoaButton2QtButton(buttonNumber); // Forward the event to the next responder if Qt did not accept the // corresponding mouse down for this button @@ -864,56 +864,59 @@ static bool _q_dontOverrideCtrlLMB = false; - (void)mouseDragged:(NSEvent *)theEvent { - const bool accepted = [self handleMouseDraggedEvent:theEvent]; + const bool accepted = [self handleMouseDraggedEvent:theEvent withButton:[theEvent buttonNumber]]; if (!accepted) [super mouseDragged:theEvent]; } - (void)mouseUp:(NSEvent *)theEvent { - const bool accepted = [self handleMouseUpEvent:theEvent]; + const bool accepted = [self handleMouseUpEvent:theEvent withButton:[theEvent buttonNumber]]; if (!accepted) [super mouseUp:theEvent]; } - (void)rightMouseDown:(NSEvent *)theEvent { - const bool accepted = [self handleMouseDownEvent:theEvent]; + // Wacom tablet might not return the correct button number for NSEvent buttonNumber + // on right clicks. Decide here that the button is the "right" button and forward + // the button number to the mouse (and tablet) handler. + const bool accepted = [self handleMouseDownEvent:theEvent withButton:1]; if (!accepted) [super rightMouseDown:theEvent]; } - (void)rightMouseDragged:(NSEvent *)theEvent { - const bool accepted = [self handleMouseDraggedEvent:theEvent]; + const bool accepted = [self handleMouseDraggedEvent:theEvent withButton:1]; if (!accepted) [super rightMouseDragged:theEvent]; } - (void)rightMouseUp:(NSEvent *)theEvent { - const bool accepted = [self handleMouseUpEvent:theEvent]; + const bool accepted = [self handleMouseUpEvent:theEvent withButton:1]; if (!accepted) [super rightMouseUp:theEvent]; } - (void)otherMouseDown:(NSEvent *)theEvent { - const bool accepted = [self handleMouseDownEvent:theEvent]; + const bool accepted = [self handleMouseDownEvent:theEvent withButton:[theEvent buttonNumber]]; if (!accepted) [super otherMouseDown:theEvent]; } - (void)otherMouseDragged:(NSEvent *)theEvent { - const bool accepted = [self handleMouseDraggedEvent:theEvent]; + const bool accepted = [self handleMouseDraggedEvent:theEvent withButton:[theEvent buttonNumber]]; if (!accepted) [super otherMouseDragged:theEvent]; } - (void)otherMouseUp:(NSEvent *)theEvent { - const bool accepted = [self handleMouseUpEvent:theEvent]; + const bool accepted = [self handleMouseUpEvent:theEvent withButton:[theEvent buttonNumber]]; if (!accepted) [super otherMouseUp:theEvent]; } @@ -1071,7 +1074,6 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash) NSPoint tilt = [theEvent tilt]; int xTilt = qRound(tilt.x * 60.0); int yTilt = qRound(tilt.y * -60.0); - Qt::MouseButtons buttons = static_cast<Qt::MouseButtons>(static_cast<uint>([theEvent buttonMask])); qreal tangentialPressure = 0; qreal rotation = 0; int z = 0; @@ -1090,10 +1092,10 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash) qCDebug(lcQpaTablet, "event on tablet %d with tool %d type %d unique ID %lld pos %6.1f, %6.1f root pos %6.1f, %6.1f buttons 0x%x pressure %4.2lf tilt %d, %d rotation %6.2lf", deviceId, deviceData.device, deviceData.pointerType, deviceData.uid, windowPoint.x(), windowPoint.y(), screenPoint.x(), screenPoint.y(), - static_cast<uint>(buttons), pressure, xTilt, yTilt, rotation); + static_cast<uint>(m_buttons), pressure, xTilt, yTilt, rotation); QWindowSystemInterface::handleTabletEvent(m_platformWindow->window(), timestamp, windowPoint, screenPoint, - deviceData.device, deviceData.pointerType, buttons, pressure, xTilt, yTilt, + deviceData.device, deviceData.pointerType, m_buttons, pressure, xTilt, yTilt, tangentialPressure, rotation, z, deviceData.uid, keyboardModifiers); return true; diff --git a/src/plugins/platforms/eglfs/api/qeglfscursor.cpp b/src/plugins/platforms/eglfs/api/qeglfscursor.cpp index 19a0e03212..f46206cab5 100644 --- a/src/plugins/platforms/eglfs/api/qeglfscursor.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfscursor.cpp @@ -410,6 +410,8 @@ struct StateSaver f->glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &arrayBuf); if (vaoHelper->isValid()) f->glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &vao); + else + vao = 0; for (int i = 0; i < 2; ++i) { f->glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_ENABLED, &va[i].enabled); f->glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_SIZE, &va[i].size); diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp index 73110dba61..8b751a72bf 100644 --- a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp @@ -452,9 +452,8 @@ void QEglFSIntegration::createInputHandlers() } #endif - bool useTslib = false; #if QT_CONFIG(tslib) - useTslib = qEnvironmentVariableIntValue("QT_QPA_EGLFS_TSLIB"); + bool useTslib = qEnvironmentVariableIntValue("QT_QPA_EGLFS_TSLIB"); if (useTslib) new QTsLibMouseHandler(QLatin1String("TsLib"), QString() /* spec */); #endif @@ -462,7 +461,9 @@ void QEglFSIntegration::createInputHandlers() #if QT_CONFIG(evdev) m_kbdMgr = new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString() /* spec */, this); new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString() /* spec */, this); +#if QT_CONFIG(tslib) if (!useTslib) +#endif new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() /* spec */, this); #endif } diff --git a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp index ce193bdf90..6f79cd96d3 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp @@ -156,9 +156,8 @@ void QLinuxFbIntegration::createInputHandlers() } #endif - bool useTslib = false; #if QT_CONFIG(tslib) - useTslib = qEnvironmentVariableIntValue("QT_QPA_FB_TSLIB"); + bool useTslib = qEnvironmentVariableIntValue("QT_QPA_FB_TSLIB"); if (useTslib) new QTsLibMouseHandler(QLatin1String("TsLib"), QString()); #endif @@ -166,7 +165,9 @@ void QLinuxFbIntegration::createInputHandlers() #if QT_CONFIG(evdev) && !defined(Q_OS_ANDROID) new QEvdevKeyboardManager(QLatin1String("EvdevKeyboard"), QString(), this); new QEvdevMouseManager(QLatin1String("EvdevMouse"), QString(), this); +#if QT_CONFIG(tslib) if (!useTslib) +#endif new QEvdevTouchManager(QLatin1String("EvdevTouch"), QString() /* spec */, this); #endif } diff --git a/src/plugins/platforms/vnc/qvncscreen.cpp b/src/plugins/platforms/vnc/qvncscreen.cpp index cd43ce4e69..67d33de2f0 100644 --- a/src/plugins/platforms/vnc/qvncscreen.cpp +++ b/src/plugins/platforms/vnc/qvncscreen.cpp @@ -131,6 +131,8 @@ void QVncScreen::enableClientCursor(QVncClient *client) if (!clientCursor) clientCursor = new QVncClientCursor(); clientCursor->addClient(client); +#else + Q_UNUSED(client) #endif } @@ -144,6 +146,8 @@ void QVncScreen::disableClientCursor(QVncClient *client) } mCursor = new QFbCursor(this); +#else + Q_UNUSED(client) #endif } diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 56275f7028..b2b5284350 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -875,6 +875,9 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, GetCursorPos(&msg.pt); } + QWindowsWindow *platformWindow = findPlatformWindow(hwnd); + *platformWindowPtr = platformWindow; + // Run the native event filters. long filterResult = 0; QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance(); @@ -883,8 +886,6 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, return true; } - QWindowsWindow *platformWindow = findPlatformWindow(hwnd); - *platformWindowPtr = platformWindow; if (platformWindow) { filterResult = 0; if (QWindowSystemInterface::handleNativeEvent(platformWindow->window(), d->m_eventType, &msg, &filterResult)) { diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp index e7ebf73d5d..8c228f588e 100644 --- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp @@ -229,7 +229,7 @@ void QWindowsInputContext::updateEnabled() const bool accepted = inputMethodAccepted(); if (QWindowsContext::verbose > 1) qCDebug(lcQpaInputMethods) << __FUNCTION__ << platformWindow->window() << "accepted=" << accepted; - QWindowsInputContext::setWindowsImeEnabled(platformWindow, accepted); + QWindowsInputContext::setWindowsImeEnabled(platformWindow, accepted); } } diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index 7ac4bdac6c..c370c2ec50 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -100,27 +100,17 @@ QT_BEGIN_NAMESPACE struct KeyInfo { KeyInfo() - : virtualKey(0) - , isAutoRepeat(false) - { - } - - KeyInfo(const QString &text, quint32 virtualKey) - : text(text) - , virtualKey(virtualKey) - , isAutoRepeat(false) { } KeyInfo(quint32 virtualKey) : virtualKey(virtualKey) - , isAutoRepeat(false) { } QString text; - quint32 virtualKey; - bool isAutoRepeat; + quint32 virtualKey{0}; + bool isAutoRepeat{false}; }; static inline Qt::ScreenOrientations qtOrientationsFromNative(DisplayOrientations native) @@ -991,9 +981,7 @@ HRESULT QWinRTScreen::onKeyDown(ABI::Windows::UI::Core::ICoreWindow *, ABI::Wind virtualKey, 0, QString(), - d->activeKeys.value(key).isAutoRepeat, - !status.RepeatCount ? 1 : status.RepeatCount, - false); + d->activeKeys.value(key).isAutoRepeat); } else { d->activeKeys.insert(key, KeyInfo(virtualKey)); } @@ -1021,9 +1009,7 @@ HRESULT QWinRTScreen::onKeyDown(ABI::Windows::UI::Core::ICoreWindow *, ABI::Wind virtualKey, 0, QString(), - d->activeKeys.value(key).isAutoRepeat, - !status.RepeatCount ? 1 : status.RepeatCount, - false); + d->activeKeys.value(key).isAutoRepeat); return S_OK; } @@ -1048,9 +1034,7 @@ HRESULT QWinRTScreen::onKeyUp(ABI::Windows::UI::Core::ICoreWindow *, ABI::Window virtualKey, 0, info.text, - false, // The final key release does not have autoRepeat set on Windows - !status.RepeatCount ? 1 : status.RepeatCount, - false); + false); // The final key release does not have autoRepeat set on Windows return S_OK; } @@ -1071,7 +1055,8 @@ HRESULT QWinRTScreen::onCharacterReceived(ICoreWindow *, ICharacterReceivedEvent const Qt::KeyboardModifiers modifiers = keyboardModifiers(); const Qt::Key key = qKeyFromCode(keyCode, modifiers); const QString text = QChar(keyCode); - const KeyInfo info = d->activeKeys.value(key); + KeyInfo &info = d->activeKeys[key]; + info.text = text; QWindowSystemInterface::handleExtendedKeyEvent( topWindow(), QEvent::KeyPress, @@ -1081,9 +1066,7 @@ HRESULT QWinRTScreen::onCharacterReceived(ICoreWindow *, ICharacterReceivedEvent info.virtualKey, 0, text, - info.isAutoRepeat, - !status.RepeatCount ? 1 : status.RepeatCount, - false); + info.isAutoRepeat); return S_OK; } diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index c77e7b6269..47702741e0 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -750,7 +750,8 @@ void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindo if (Q_UNLIKELY(lcQpaXInputEvents().isDebugEnabled())) qCDebug(lcQpaXInputEvents) << " touchpoint " << touchPoint.id << " state " << touchPoint.state << " pos norm " << touchPoint.normalPosition << " area " << touchPoint.area << " pressure " << touchPoint.pressure; - QWindowSystemInterface::handleTouchEvent(platformWindow->window(), xiDeviceEvent->time, dev->qtTouchDevice, dev->touchPoints.values()); + Qt::KeyboardModifiers modifiers = keyboard()->translateModifiers(xiDeviceEvent->mods.effective_mods); + QWindowSystemInterface::handleTouchEvent(platformWindow->window(), xiDeviceEvent->time, dev->qtTouchDevice, dev->touchPoints.values(), modifiers); if (touchPoint.state == Qt::TouchPointReleased) // If a touchpoint was released, we can forget it, because the ID won't be reused. dev->touchPoints.remove(touchPoint.id); @@ -1221,9 +1222,8 @@ void QXcbConnection::xi2ReportTabletEvent(const void *event, TabletData *tabletD return; QWindow *window = xcbWindow->window(); const Qt::KeyboardModifiers modifiers = keyboard()->translateModifiers(ev->mods.effective_mods); - const double scale = 65536.0; - QPointF local(ev->event_x / scale, ev->event_y / scale); - QPointF global(ev->root_x / scale, ev->root_y / scale); + QPointF local(fixed1616ToReal(ev->event_x), fixed1616ToReal(ev->event_y)); + QPointF global(fixed1616ToReal(ev->root_x), fixed1616ToReal(ev->root_y)); double pressure = 0, rotation = 0, tangentialPressure = 0; int xTilt = 0, yTilt = 0; @@ -1265,8 +1265,7 @@ void QXcbConnection::xi2ReportTabletEvent(const void *event, TabletData *tabletD "pos %6.1f, %6.1f root pos %6.1f, %6.1f buttons 0x%x pressure %4.2lf tilt %d, %d rotation %6.2lf modifiers 0x%x", tabletData->deviceId, toolName(tabletData->tool), pointerTypeName(tabletData->pointerType), ev->sequenceNumber, ev->detail, ev->time, - fixed1616ToReal(ev->event_x), fixed1616ToReal(ev->event_y), - fixed1616ToReal(ev->root_x), fixed1616ToReal(ev->root_y), + local.x(), local.y(), global.x(), global.y(), (int)tabletData->buttons, pressure, xTilt, yTilt, rotation, (int)modifiers); QWindowSystemInterface::handleTabletEvent(window, ev->time, local, global, |