backends/x11: convert source cursor image to BGRX format

XCB_IMAGE_FORMAT_Z_PIXMAP is in BGRX format.

BUG: 476198
FIXED-IN: 6.0
This commit is contained in:
Fushan Wen 2024-01-09 17:04:01 +00:00
parent 9bbcc746c6
commit a4283a2437

View file

@ -106,7 +106,7 @@ void X11WindowedCursor::update(const QImage &image, const QPointF &hotspot)
// right now on X we only have one scale between all screens, and we know we will have at least one screen
const qreal outputScale = 1;
const QSize targetSize = image.size() * outputScale / image.devicePixelRatio();
const QImage img = image.scaled(targetSize, Qt::KeepAspectRatio);
const QImage img = image.scaled(targetSize, Qt::KeepAspectRatio).convertedTo(QImage::Format_ARGB32_Premultiplied);
xcb_create_pixmap(connection, 32, pix, backend->screen()->root, img.width(), img.height());
xcb_create_gc(connection, gc, pix, 0, nullptr);