diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-03-08 09:27:37 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-03-08 09:27:38 +0100 |
commit | 332ce6734d29fb03852d04de6bc648289ff1c35d (patch) | |
tree | 30713dba37e3a98c7606c18f044ab4a815863288 /src/plugins/platforms/windows | |
parent | 2056bc6bc51efa1da61098ba3d213a4e25d9e7d8 (diff) | |
parent | caa5a20479bd58fda4380181691f772a1f3c1da4 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Idf471ca5c6cf211813466b539ce45bdc1ae9b97c
Diffstat (limited to 'src/plugins/platforms/windows')
4 files changed, 18 insertions, 3 deletions
diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp index db06f81434..593ff3cef1 100644 --- a/src/plugins/platforms/windows/qwindowsdrag.cpp +++ b/src/plugins/platforms/windows/qwindowsdrag.cpp @@ -412,7 +412,8 @@ QWindowsOleDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState) const QPoint localPos = m_windowUnderMouse->handle()->mapFromGlobal(globalPos); QWindowSystemInterface::handleMouseEvent(m_windowUnderMouse.data(), QPointF(localPos), QPointF(globalPos), - QWindowsMouseHandler::queryMouseButtons()); + QWindowsMouseHandler::queryMouseButtons(), + Qt::LeftButton, QEvent::MouseButtonRelease); } } m_currentButtons = Qt::NoButton; diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index c0781df973..66d3b140e2 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -318,6 +318,15 @@ void QWindowsScreen::handleChanges(const QWindowsScreenData &newData) } } +QRect QWindowsScreen::virtualGeometry(const QPlatformScreen *screen) // cf QScreen::virtualGeometry() +{ + QRect result; + const auto siblings = screen->virtualSiblings(); + for (const QPlatformScreen *sibling : siblings) + result |= sibling->geometry(); + return result; +} + enum OrientationPreference // matching Win32 API ORIENTATION_PREFERENCE #if defined(Q_COMPILER_CLASS_ENUM) || defined(Q_CC_MSVC) : DWORD diff --git a/src/plugins/platforms/windows/qwindowsscreen.h b/src/plugins/platforms/windows/qwindowsscreen.h index 7cf73f03af..5753e605da 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.h +++ b/src/plugins/platforms/windows/qwindowsscreen.h @@ -113,6 +113,8 @@ public: const QWindowsScreenData &data() const { return m_data; } + static QRect virtualGeometry(const QPlatformScreen *screen); + private: QWindowsScreenData m_data; #ifndef QT_NO_CURSOR diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp index 5fdc664603..78e33e57ab 100644 --- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp +++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp @@ -421,7 +421,8 @@ bool QWindowsTabletSupport::translateTabletPacketEvent() // in which case we snap the position to the mouse position. // It seems there is no way to find out the mode programmatically, the LOGCONTEXT orgX/Y/Ext // area is always the virtual desktop. - const QRect virtualDesktopArea = QGuiApplication::primaryScreen()->virtualGeometry(); + const QRect virtualDesktopArea = + QWindowsScreen::virtualGeometry(QGuiApplication::primaryScreen()->handle()); qCDebug(lcQpaTablet) << __FUNCTION__ << "processing " << packetCount << "target:" << QGuiApplicationPrivate::tabletDevicePoint(uniqueId).target; @@ -455,7 +456,9 @@ bool QWindowsTabletSupport::translateTabletPacketEvent() if (!target) continue; - const QPoint localPos = target->mapFromGlobal(globalPos); + const QPlatformWindow *platformWindow = target->handle(); + Q_ASSERT(platformWindow); + const QPoint localPos = platformWindow->mapFromGlobal(globalPos); const qreal pressureNew = packet.pkButtons && (currentPointer == QTabletEvent::Pen || currentPointer == QTabletEvent::Eraser) ? m_devices.at(m_currentDevice).scalePressure(packet.pkNormalPressure) : |