Do not update scroll coordinates on ignorable enter events

This greatly reduces how often we reset the scroll evaluators,
especially with non-focused windows in KWin which sends an enter for
every wheel events in that case.

The update of the evaluators also has race conditions with the normal
events, and thus reducing them fixes odd scrolling behavior with rapid
firing mouse wheels.

Task-number: QTBUG-42415
Task-number: QTBUG-68734
Change-Id: I1c14ca3352bf9c6e57e47ad3aaee1712fe6ba30b
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This commit is contained in:
Allan Sandfeld Jensen 2018-06-21 16:54:12 +02:00
parent 4fa8dfee5d
commit d2c0ba3f30

View File

@ -2251,15 +2251,15 @@ void QXcbWindow::handleEnterNotifyEvent(int event_x, int event_y, int root_x, in
quint8 mode, quint8 detail, xcb_timestamp_t timestamp)
{
connection()->setTime(timestamp);
#ifdef XCB_USE_XINPUT21
// Updates scroll valuators, as user might have done some scrolling outside our X client.
connection()->xi2UpdateScrollingDevices();
#endif
const QPoint global = QPoint(root_x, root_y);
if (ignoreEnterEvent(mode, detail, connection()) || connection()->mousePressWindow())
return;
#ifdef XCB_USE_XINPUT21
// Updates scroll valuators, as user might have done some scrolling outside our X client.
connection()->xi2UpdateScrollingDevices();
#endif
const QPoint local(event_x, event_y);
QWindowSystemInterface::handleEnterEvent(window(), local, global);