summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsdrag.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsdrag.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsdrag.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp
index aa6454ef63..777c45ae86 100644
--- a/src/plugins/platforms/windows/qwindowsdrag.cpp
+++ b/src/plugins/platforms/windows/qwindowsdrag.cpp
@@ -246,7 +246,7 @@ private:
typedef QMap<Qt::DropAction, CursorEntry> ActionCursorMap;
- const Mode m_mode;
+ Mode m_mode;
QWindowsDrag *m_drag;
Qt::MouseButtons m_currentButtons;
ActionCursorMap m_cursors;
@@ -301,6 +301,15 @@ void QWindowsOleDropSource::createCursors()
Q_ASSERT(platformScreen);
QPlatformCursor *platformCursor = platformScreen->cursor();
+ if (GetSystemMetrics (SM_REMOTESESSION) != 0) {
+ /* Workaround for RDP issues with large cursors.
+ * Touch drag window seems to work just fine...
+ * 96 pixel is a 'large' mouse cursor, according to RDP spec */
+ const int rdpLargeCursor = qRound(qreal(96) / QHighDpiScaling::factor(platformScreen));
+ if (pixmap.width() > rdpLargeCursor || pixmap.height() > rdpLargeCursor)
+ m_mode = TouchDrag;
+ }
+
qreal pixmapScaleFactor = 1;
qreal hotSpotScaleFactor = 1;
if (m_mode != TouchDrag) { // Touch drag: pixmap is shown in a separate QWindow, which will be scaled.)
@@ -433,6 +442,9 @@ QWindowsOleDropSource::GiveFeedback(DWORD dwEffect)
SetCursor(e.cursor->handle());
break;
case TouchDrag:
+ // "Touch drag" with an unsuppressed cursor may happen with RDP (see createCursors())
+ if (QWindowsCursor::cursorState() != QWindowsCursor::CursorSuppressed)
+ SetCursor(nullptr);
if (!m_touchDragWindow)
m_touchDragWindow = new QWindowsDragCursorWindow;
m_touchDragWindow->setPixmap(e.pixmap);