From 05c8e51d884d7130e3f26701a7955ebc2026bb12 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 19 Nov 2015 13:39:52 +0100 Subject: Windows: Scale cursors from resource pixmaps according to screen. QWindowsCursor::customCursor() uses a best match algorithm to find the most suitable pixmap for the cursor size obtained from GetSystemMetrics(). This size is correct for the primary screen only; in High DPI + normal monitor multiscreen-environments, the cursors will be too large on the secondary monitor. Pass the platform screen to apply a correction factor based on logical DPI to obtain the correct size. Task-number: QTBUG-49511 Change-Id: I8a64a969e3ade7ab5029e3ae904a0bcbb4704f90 Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowscursor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowscursor.h') diff --git a/src/plugins/platforms/windows/qwindowscursor.h b/src/plugins/platforms/windows/qwindowscursor.h index ac4462f131..558e807201 100644 --- a/src/plugins/platforms/windows/qwindowscursor.h +++ b/src/plugins/platforms/windows/qwindowscursor.h @@ -104,9 +104,9 @@ public: static HCURSOR createPixmapCursor(QPixmap pixmap, const QPoint &hotSpot, qreal scaleFactor = 1); static HCURSOR createPixmapCursor(const PixmapCursor &pc, qreal scaleFactor = 1) { return createPixmapCursor(pc.pixmap, pc.hotSpot, scaleFactor); } - static PixmapCursor customCursor(Qt::CursorShape cursorShape); + static PixmapCursor customCursor(Qt::CursorShape cursorShape, const QPlatformScreen *screen = Q_NULLPTR); - static HCURSOR createCursorFromShape(Qt::CursorShape cursorShape); + static HCURSOR createCursorFromShape(Qt::CursorShape cursorShape, const QPlatformScreen *screen = Q_NULLPTR); static QPoint mousePosition(); static CursorState cursorState(); -- cgit v1.2.3