From 815341dbec1fd4f04fe76fc438cc9b3308ffafe9 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 11 Oct 2016 16:42:11 +0200 Subject: 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 --- src/plugins/platforms/eglfs/api/qeglfscursor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/eglfs/api/qeglfscursor.cpp') diff --git a/src/plugins/platforms/eglfs/api/qeglfscursor.cpp b/src/plugins/platforms/eglfs/api/qeglfscursor.cpp index 1b3446c4ac..2b54251a06 100644 --- a/src/plugins/platforms/eglfs/api/qeglfscursor.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfscursor.cpp @@ -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()); -- cgit v1.2.3