QApplication: fix scroll phase handling for wheel events
Set scroll phase correctly for propagated wheel events, and do not let Qt::ScrollBegin/End steal focus when using Qt::WheelFocus policy. Change-Id: Ia38b64059d96a228c3b83c9b455db6e30dfb9a46 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>bb10
parent
3e3d06d705
commit
5bcb87babf
|
|
@ -3097,12 +3097,12 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
|
|||
QPoint relpos = wheel->pos();
|
||||
bool eventAccepted = wheel->isAccepted();
|
||||
|
||||
if (e->spontaneous())
|
||||
if (e->spontaneous() && wheel->phase() == Qt::ScrollUpdate)
|
||||
QApplicationPrivate::giveFocusAccordingToFocusPolicy(w, e, relpos);
|
||||
|
||||
while (w) {
|
||||
QWheelEvent we(relpos, wheel->globalPos(), wheel->pixelDelta(), wheel->angleDelta(), wheel->delta(), wheel->orientation(), wheel->buttons(),
|
||||
wheel->modifiers());
|
||||
wheel->modifiers(), wheel->phase());
|
||||
we.spont = wheel->spontaneous();
|
||||
res = d->notify_helper(w, w == receiver ? wheel : &we);
|
||||
eventAccepted = ((w == receiver) ? wheel : &we)->isAccepted();
|
||||
|
|
|
|||
Loading…
Reference in New Issue