-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.12.0
-
None
Update: patch provided below, see comments.
While porting a CAD application from Qt4 to Qt5 I noticed that mouse wheel events are often ignored when the mouse is simultaneously being moved and the application is busy drawing things. The events get through just fine when the mouse is not moving and the application is idle, but when I move the mouse it triggers paint events continuously, and nearly all mouse wheel events are lost. When one event finally gets through, the 'delta' value contains the accumulated value from all the ignored events, so clearly the events did reach Qt, but simply weren't passed on to the application.
I suspect that the bug is located in the code that is responsible for merging mouse events: apparently the merged mouse move events are masking the merged mouse wheel events.
The problem in this StackOverflow post seems to be caused by the same bug.
I've attached a minimal example that reproduces the problem. There's a sleep(100) call in the paint event to simulate slow painting in the CAD application. The example app draws a circle that follows the mouse, the size of which can be changed with the mouse wheel. When the mouse is moved continuously, it becomes nearly impossible to change the size of the circle since nearly all the wheel events are lost.
For Gerrit Dashboard: QTBUG-73155 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
257166,11 | xcb: improve event compression to distinguish between mouse and scroll | dev | qt/qtbase | Status: NEW | 0 | 0 |