diff --git a/autotests/integration/pointer_input.cpp b/autotests/integration/pointer_input.cpp index b5d61713e3..1b2695f4fd 100644 --- a/autotests/integration/pointer_input.cpp +++ b/autotests/integration/pointer_input.cpp @@ -882,6 +882,19 @@ void PointerInputTest::testCursorImage() QTRY_COMPARE(p->cursorImage(), blue); QCOMPARE(p->cursorHotSpot(), QPoint(6, 6)); + // scaled cursor + QImage blueScaled = QImage(QSize(20, 20), QImage::Format_ARGB32_Premultiplied); + blueScaled.fill(Qt::blue); + auto bs = Test::waylandShmPool()->createBuffer(blueScaled); + cursorSurface->attachBuffer(bs); + cursorSurface->setScale(2); + cursorSurface->damage(QRect(0, 0, 20, 20)); + cursorSurface->commit(); + QVERIFY(cursorRenderedSpy.wait()); + QTRY_COMPARE(p->cursorImage(), blueScaled); + QCOMPARE(p->cursorImage().devicePixelRatio(), 2.0); + QCOMPARE(p->cursorHotSpot(), QPoint(6, 6)); //surface-local (so not changed) + // hide the cursor pointer->setCursor(nullptr); Test::flushWaylandConnection(); diff --git a/pointer_input.cpp b/pointer_input.cpp index 2c6e33ebae..1a59dbb7f4 100644 --- a/pointer_input.cpp +++ b/pointer_input.cpp @@ -1063,6 +1063,7 @@ void CursorImage::updateServerCursor() } m_serverCursor.hotSpot = c->hotspot(); m_serverCursor.image = buffer->data().copy(); + m_serverCursor.image.setDevicePixelRatio(cursorSurface->scale()); if (needsEmit) { emit changed(); }