summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-02-28 10:32:56 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-02-28 10:32:56 +0100
commit96ffe48add521e29d883814a35b1130b9dfdd636 (patch)
treed0ae779efa69ecb8c39999786af22152db902806 /src/plugins/platforms
parent37217c57fa5595e7cdfd7e19f34de22848dfc370 (diff)
parenteba652a99f602386127e552740fddf5445b3d7c9 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/windows/qwindowsdrag.cpp16
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp14
2 files changed, 22 insertions, 8 deletions
diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp
index 777c45ae86..db06f81434 100644
--- a/src/plugins/platforms/windows/qwindowsdrag.cpp
+++ b/src/plugins/platforms/windows/qwindowsdrag.cpp
@@ -248,6 +248,7 @@ private:
Mode m_mode;
QWindowsDrag *m_drag;
+ QPointer<QWindow> m_windowUnderMouse;
Qt::MouseButtons m_currentButtons;
ActionCursorMap m_cursors;
QWindowsDragCursorWindow *m_touchDragWindow;
@@ -260,6 +261,7 @@ private:
QWindowsOleDropSource::QWindowsOleDropSource(QWindowsDrag *drag)
: m_mode(QWindowsCursor::cursorState() != QWindowsCursor::CursorSuppressed ? MouseDrag : TouchDrag)
, m_drag(drag)
+ , m_windowUnderMouse(QWindowsContext::instance()->windowUnderMouse())
, m_currentButtons(Qt::NoButton)
, m_touchDragWindow(0)
{
@@ -400,7 +402,19 @@ QWindowsOleDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState)
case DRAGDROP_S_DROP:
case DRAGDROP_S_CANCEL:
QGuiApplicationPrivate::modifier_buttons = toQtKeyboardModifiers(grfKeyState);
- QGuiApplicationPrivate::mouse_buttons = buttons;
+ if (buttons != QGuiApplicationPrivate::mouse_buttons) {
+ if (m_windowUnderMouse.isNull() || m_mode == TouchDrag || fEscapePressed == TRUE) {
+ QGuiApplicationPrivate::mouse_buttons = buttons;
+ } else {
+ // QTBUG 66447: Synthesize a mouse release to the window under mouse at
+ // start of the DnD operation as Windows does not send any.
+ const QPoint globalPos = QWindowsCursor::mousePosition();
+ const QPoint localPos = m_windowUnderMouse->handle()->mapFromGlobal(globalPos);
+ QWindowSystemInterface::handleMouseEvent(m_windowUnderMouse.data(),
+ QPointF(localPos), QPointF(globalPos),
+ QWindowsMouseHandler::queryMouseButtons());
+ }
+ }
m_currentButtons = Qt::NoButton;
break;
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
index 22d90d6ac2..db44e58cbb 100644
--- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
+++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp
@@ -306,13 +306,13 @@ QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbNativeInterfa
return func;
if (lowerCaseResource == "setstartupid")
- return NativeResourceForIntegrationFunction(setStartupId);
+ return NativeResourceForIntegrationFunction(reinterpret_cast<void *>(setStartupId));
if (lowerCaseResource == "generatepeekerid")
- return NativeResourceForIntegrationFunction(generatePeekerId);
+ return NativeResourceForIntegrationFunction(reinterpret_cast<void *>(generatePeekerId));
if (lowerCaseResource == "removepeekerid")
- return NativeResourceForIntegrationFunction(removePeekerId);
+ return NativeResourceForIntegrationFunction(reinterpret_cast<void *>(removePeekerId));
if (lowerCaseResource == "peekeventqueue")
- return NativeResourceForIntegrationFunction(peekEventQueue);
+ return NativeResourceForIntegrationFunction(reinterpret_cast<void *>(peekEventQueue));
return 0;
}
@@ -334,9 +334,9 @@ QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterface::n
return func;
if (lowerCaseResource == "setapptime")
- return NativeResourceForScreenFunction(setAppTime);
+ return NativeResourceForScreenFunction(reinterpret_cast<void *>(setAppTime));
else if (lowerCaseResource == "setappusertime")
- return NativeResourceForScreenFunction(setAppUserTime);
+ return NativeResourceForScreenFunction(reinterpret_cast<void *>(setAppUserTime));
return 0;
}
@@ -388,7 +388,7 @@ QFunctionPointer QXcbNativeInterface::platformFunction(const QByteArray &functio
}
if (function == QXcbScreenFunctions::virtualDesktopNumberIdentifier())
- return QFunctionPointer(QXcbScreenFunctions::VirtualDesktopNumber(QXcbScreen::virtualDesktopNumberStatic));
+ return QFunctionPointer(QXcbScreenFunctions::VirtualDesktopNumber(reinterpret_cast<void *>(QXcbScreen::virtualDesktopNumberStatic)));
return nullptr;
}