Commit 2cc42ecc authored by David Edmundson's avatar David Edmundson
Browse files

DRM cursor scaling

We pass the buffer scale of the cursor through QImage::devicePixelRatio.

When copying the cursor with QPainter use Qt's in-built functionality to
handle resizing the cursor pixmap as necessary to match the screen.

As we're now resizing the cursor, the hotspot needs translating from
logical to device co-ordinates.

Test Plan: Used with associated patches

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision:
parent 9ff1f77e
......@@ -132,6 +132,8 @@ void DrmOutput::updateCursor()
m_hasNewCursor = true;
QImage *c = m_cursor[m_cursorIndex]->image();
QPainter p;
if (m_orientation == Qt::InvertedLandscapeOrientation) {
......@@ -158,6 +160,7 @@ void DrmOutput::moveCursor(const QPoint &globalPos)
hotspotMatrix.rotate(180.0f, 0.0f, 0.0f, 1.0f);
hotspotMatrix.translate(-cursorSize.width()/2.0, -cursorSize.height()/2.0);
matrix.translate(-m_globalPos.x(), -m_globalPos.y());
const QPoint p = ->softwareCursorHotspot());
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment