@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2015 Canonical, Ltd.
2+ * Copyright (C) 2015-2016 Canonical, Ltd.
33 *
44 * This program is free software: you can redistribute it and/or modify it under
55 * the terms of the GNU Lesser General Public License version 3, as published by
@@ -43,7 +43,12 @@ void MousePointer::handleMouseEvent(ulong timestamp, QPointF movement, Qt::Mouse
4343 Q_EMIT mouseMoved();
4444 }
4545
46− qreal newX = x() + movement.x();
46+ m_accumulatedMovement += movement;
47+ // don't apply the fractional part
48+ QPointF appliedMovement(int(m_accumulatedMovement.x()), int(m_accumulatedMovement.y()));
49+ m_accumulatedMovement -= appliedMovement;
50+
51+ qreal newX = x() + appliedMovement.x();
4752 if (newX < 0) {
4853 Q_EMIT pushedLeftBoundary(qAbs(newX), buttons);
4954 newX = 0;
@@ -53,7 +58,7 @@ void MousePointer::handleMouseEvent(ulong timestamp, QPointF movement, Qt::Mouse
5358 }
5459 setX(newX);
5560
56− qreal newY = y() + movement.y();
61+ qreal newY = y() + appliedMovement.y();
5762 if (newY < 0) {
5863 newY = 0;
5964 } else if (newY > parentItem()->height()) {