Page 1 of 1

Patch: some mouse events are treated twice

Posted: 30 Jan 2008 08:58
by illogict
Hello!

While porting for Maemo, I observed that some mouse events were treated twice. In fact, video subparts generate an event and thus call HandleMouseEvents themselves, but HandleMouseEvents is also called in InputLoop, thus leading to mouse events being treated twice in race conditions. This patch will remove the call in InputLoop.

Please comment.

Edit : I didn't saw that there was a bugs manager, I have just posted that patch there: http://bugs.openttd.org/task/1725

Re: Patch: some mouse events are treated twice

Posted: 31 Jan 2008 10:19
by illogict
Here is an updated version of the patch.
As for scrolling, now HandleMouseEvents will not be called in InputLoop unless there were no InputEvents during the tick.
Please comment.

Re: Patch: some mouse events are treated twice

Posted: 02 Feb 2008 22:02
by Zuu
I built two binaries on Linux one without your patch and one with patch and ran them in windowed mode side by side so that I could test and see if i could notice any difference. I only did move around a few minutes.

Using my Wacom in absolute addressing mode I did not noticed any difference.

Using my trackball (relative addressed device) I did neither notice any differences between with or without your patch.

Re: Patch: some mouse events are treated twice

Posted: 03 Feb 2008 14:44
by illogict
In fact, the problem this patch solves is to be noticed only on slow devices, on which this race condition can occur, like the n810.