Get rid of QMutableEventPoint::stationaryWithModifiedProperty
Omitting stationary points from touch events is such a marginal optimization that this code probably isn't worth maintaining. It wasn't implemented correctly this time either, according to the tst_QQuickMultiPointTouchArea::stationaryTouchWithChangingPressure() test. [ChangeLog][QtGui][QPointerEvent] We no longer attempt to avoid delivery of stationary points within QTouchEvent: every pressed point is now included in every TouchUpdate event. Task-number: QTBUG-77142 Change-Id: If1fd666fb3057a17e0dffdd7ca7138693126b02b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
aa5f2bf836
commit
1783b048fd
@ -472,15 +472,6 @@ void QMutableEventPoint::updateFrom(const QEventPoint &other)
|
|||||||
setPressure(0);
|
setPressure(0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEventPoint::State::Stationary:
|
|
||||||
// Stationary points might not be delivered down to the receiving item
|
|
||||||
// and get their position transformed, keep the old values instead.
|
|
||||||
if (other.velocity() != velocity() ||
|
|
||||||
!qFuzzyCompare(other.pressure(), pressure())) {
|
|
||||||
setStationaryWithModifiedProperty();
|
|
||||||
}
|
|
||||||
Q_FALLTHROUGH();
|
|
||||||
|
|
||||||
default: // update or stationary
|
default: // update or stationary
|
||||||
if (globalPosition() != other.globalPosition())
|
if (globalPosition() != other.globalPosition())
|
||||||
setGlobalLastPosition(globalPosition());
|
setGlobalLastPosition(globalPosition());
|
||||||
|
@ -88,7 +88,6 @@ struct QEventPointPrivate {
|
|||||||
int pointId = -1;
|
int pointId = -1;
|
||||||
QEventPoint::State state = QEventPoint::State::Unknown;
|
QEventPoint::State state = QEventPoint::State::Unknown;
|
||||||
bool accept = false;
|
bool accept = false;
|
||||||
bool stationaryWithModifiedProperty = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Private subclasses to allow accessing and modifying protected variables.
|
// Private subclasses to allow accessing and modifying protected variables.
|
||||||
@ -119,8 +118,6 @@ public:
|
|||||||
|
|
||||||
void detach();
|
void detach();
|
||||||
|
|
||||||
bool stationaryWithModifiedProperty() const { return d->stationaryWithModifiedProperty; }
|
|
||||||
|
|
||||||
void setId(int pointId) { d->pointId = pointId; }
|
void setId(int pointId) { d->pointId = pointId; }
|
||||||
|
|
||||||
void setDevice(const QPointingDevice *device) { d->device = device; }
|
void setDevice(const QPointingDevice *device) { d->device = device; }
|
||||||
@ -163,8 +160,6 @@ public:
|
|||||||
|
|
||||||
void setVelocity(const QVector2D &v) { d->velocity = v; }
|
void setVelocity(const QVector2D &v) { d->velocity = v; }
|
||||||
|
|
||||||
void setStationaryWithModifiedProperty(bool s = true) { d->stationaryWithModifiedProperty = s; }
|
|
||||||
|
|
||||||
QWindow *window() const { return d->window.data(); }
|
QWindow *window() const { return d->window.data(); }
|
||||||
|
|
||||||
void setWindow(const QPointer<QWindow> &w) { d->window = w; }
|
void setWindow(const QPointer<QWindow> &w) { d->window = w; }
|
||||||
|
@ -2856,7 +2856,6 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
|
|||||||
|
|
||||||
self->lastTouchType = e->touchType;
|
self->lastTouchType = e->touchType;
|
||||||
|
|
||||||
bool stationaryTouchPointChangedProperty = false;
|
|
||||||
QPointer<QWindow> window = e->window; // the platform hopefully tells us which window received the event
|
QPointer<QWindow> window = e->window; // the platform hopefully tells us which window received the event
|
||||||
QVarLengthArray<QMutableTouchEvent, 2> touchEvents;
|
QVarLengthArray<QMutableTouchEvent, 2> touchEvents;
|
||||||
|
|
||||||
@ -2944,11 +2943,6 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
|
|||||||
case QEventPoint::State::Released:
|
case QEventPoint::State::Released:
|
||||||
eventType = QEvent::TouchEnd;
|
eventType = QEvent::TouchEnd;
|
||||||
break;
|
break;
|
||||||
case QEventPoint::State::Stationary:
|
|
||||||
// don't send the event if nothing changed
|
|
||||||
if (!stationaryTouchPointChangedProperty)
|
|
||||||
continue;
|
|
||||||
Q_FALLTHROUGH();
|
|
||||||
default:
|
default:
|
||||||
eventType = QEvent::TouchUpdate;
|
eventType = QEvent::TouchUpdate;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user