Event handler drops some events when rate of incoming events is high
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
qt4-x11 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jaunty |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The Qt event handler seems to drop events when lots of events are sent to it in a short amount of time.
I created a pair of test programs that demonstrates the problem. You can find them at:
http://
http://
The information to reproduce the problem is in README. The sendkey program takes in keys from stdin and sends corresponding X events to eventtest, which buffers the keys and prints them to stdout every time a Return event is received. You will (hopefully) see that the input to sendkey does not match the output of eventtest (which is missing characters).
As an example, given the following input to sendkey...
ABCDEFGHIJKLMNO
ABCDEFGHIJKLMNO
ABCDEFGHIJKLMNO
ABCDEFGHIJKLMNO
ABCDEFGHIJKLMNO
ABCDEFGHIJKLMNO
...the eventtest program might print the following (on the systems I tested)...
ABCDEFGHIJKLMNO
ABCDEFGHIJKLMNO
ABCDEFGHIJKLMNO
ABCDEFGHIJKLMNO
DEFGHIJKLMNOPQR
TUVWXYZ01234567
...which shows that a large number of events are being dropped.
I have been able to reproduce the problem on the following systems:
- Ubuntu 8.04.1 with Qt 4.3.4 on a 1.3 GHz Pentium M
- Ubuntu 8.04.1 with Qt 4.4.0 on a 1.1 GHz Pentium M
Other applications I've tested, including gedit, the GNOME Terminal, and KEdit, do not miss any events using a similar test methodology.
The attached patch fixes the bug. The patch is from Bradley Hughes at Trolltech and was originally published on the qt-interest mailing list:
http:// lists.trolltech .com/qt- interest/ 2008-10/ thread00773- 0.html# msg00844
Additionally, I have reproduced this bug using the libqt4-dev 4.4.3 package included in the Ubuntu 8.10 repositories.
A Trolltech software engineer confirmed by private e-mail that this fix will be in Qt 4.5. I would recommend that it also be applied to Ubuntu's Qt 4.4.3 package so that users of Ubuntu 8.10 can benefit from it immediately.