TechDraw: Buggy Wayland custom cursors workaround (#16740)

* Gui: Minor polishing of cursor regression fix

* TD: Buggy Wayland custom cursors workaround

Until Qt v6.6 displaying custom cursors on Wayland is broken,
so add a workaround. See also QTBUG-95434.

Fix is the same as 094c1b10 ("Gui: Buggy Wayland custom cursors workaround")
plus subsequent fixes.
This commit is contained in:
3x380V
2024-09-23 17:43:10 +02:00
committed by GitHub
parent c74378be11
commit 2443f3ebb4
2 changed files with 24 additions and 13 deletions

View File

@@ -656,11 +656,10 @@ static QCursor createCursor(QBitmap &bitmap, QBitmap &mask, int hotX, int hotY,
Q_UNUSED(dpr)
#endif
#ifdef HAS_QTBUG_95434
QPixmap pixmap;
if (qGuiApp->platformName() == QLatin1String("wayland")) {
QImage img = bitmap.toImage();
img.convertTo(QImage::Format_ARGB32);
pixmap = QPixmap::fromImage(img);
QPixmap pixmap = QPixmap::fromImage(img);
pixmap.setMask(mask);
return QCursor(pixmap, hotX, hotY);
}