diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-10-11 16:42:11 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-10-13 19:07:23 +0000 |
commit | 815341dbec1fd4f04fe76fc438cc9b3308ffafe9 (patch) | |
tree | bfc8ee5d34d68663f9b9315417395f7ad0f78581 /src/plugins/platforms/eglfs/api | |
parent | 542a76c490cee7359f9c5116248977cab72b7b63 (diff) |
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>
Diffstat (limited to 'src/plugins/platforms/eglfs/api')
-rw-r--r-- | src/plugins/platforms/eglfs/api/qeglfscursor.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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()); |