Patch: some mouse events are treated twice

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
illogict
Engineer
Engineer
Posts: 12
Joined: 27 Jul 2005 14:24
Location: Évry (France)
Contact:

Patch: some mouse events are treated twice

Post 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
Attachments
twice_treated_mouse_events.patch
Patch to correct mouse events treated twice
(255 Bytes) Downloaded 160 times
Image
illogict
Engineer
Engineer
Posts: 12
Joined: 27 Jul 2005 14:24
Location: Évry (France)
Contact:

Re: Patch: some mouse events are treated twice

Post 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.
Attachments
twice_treated_mouse_events-updated.patch
(986 Bytes) Downloaded 210 times
Image
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Patch: some mouse events are treated twice

Post 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.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
illogict
Engineer
Engineer
Posts: 12
Joined: 27 Jul 2005 14:24
Location: Évry (France)
Contact:

Re: Patch: some mouse events are treated twice

Post 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.
Image
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 7 guests