eglfs: Fix deformed mouse cursor image

In 5.8 cr got changed to QRect from QRectF. This is incorrect without
adjusting the calculations based on it since QRect and QRectF's right()
and bottom() differs by 1.

Switch back to QRectF.

Task-number: QTBUG-56478
Change-Id: I5bde4ee59ca9bbf62f65493c66f42707032bfc80
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
Laszlo Agocs 2016-10-11 16:42:11 +02:00
parent 542a76c490
commit 815341dbec

View File

@ -341,14 +341,16 @@ void QEglFSCursor::paintOnScreen()
if (!m_visible)
return;
QRect cr = cursorRect(); // hotspot included
// cr must be a QRectF, otherwise cr.right() and bottom() would be off by
// one in the calculations below.
QRectF cr = cursorRect(); // hotspot included
// Support virtual desktop too. Backends with multi-screen support (e.g. all
// variants of KMS/DRM) will enable this by default. In this case all
// screens are siblings of each other. When not enabled, the sibling list
// only contains m_screen itself.
for (QPlatformScreen *screen : m_screen->virtualSiblings()) {
if (screen->geometry().contains(cr.topLeft() + m_cursor.hotSpot)
if (screen->geometry().contains(cr.topLeft().toPoint() + m_cursor.hotSpot)
&& QOpenGLContext::currentContext()->screen() == screen->screen())
{
cr.translate(-screen->geometry().topLeft());