Use SmoothPixmapTransform when drawing cursor

This solves the pixelated look of the cursor under wayland, if the
scaling is set to a fractional value.
This commit is contained in:
Julius Zint 2021-12-09 15:51:06 +01:00
parent ab9bfb2993
commit 9537ea6d16
2 changed files with 2 additions and 0 deletions

View file

@ -157,6 +157,7 @@ bool DrmOutput::updateCursor()
QPainter p; QPainter p;
p.begin(c); p.begin(c);
p.setWorldTransform(logicalToNativeMatrix(cursor->rect(), 1, transform()).toTransform()); p.setWorldTransform(logicalToNativeMatrix(cursor->rect(), 1, transform()).toTransform());
p.setRenderHint(QPainter::SmoothPixmapTransform);
p.drawImage(QPoint(0, 0), cursorImage); p.drawImage(QPoint(0, 0), cursorImage);
p.end(); p.end();
return m_pipeline->setCursor(m_cursor->currentBuffer(), logicalToNativeMatrix(cursor->rect(), scale(), transform()).map(cursor->hotspot())); return m_pipeline->setCursor(m_cursor->currentBuffer(), logicalToNativeMatrix(cursor->rect(), scale(), transform()).map(cursor->hotspot()));

View file

@ -390,6 +390,7 @@ void ScreenShotEffect::grabPointerImage(QImage &snapshot, int xOffset, int yOffs
} }
QPainter painter(&snapshot); QPainter painter(&snapshot);
painter.setRenderHint(QPainter::SmoothPixmapTransform);
painter.drawImage(effects->cursorPos() - cursor.hotSpot() - QPoint(xOffset, yOffset), cursor.image()); painter.drawImage(effects->cursorPos() - cursor.hotSpot() - QPoint(xOffset, yOffset), cursor.image());
} }