Automatic migration. Original reporter: "ilveroluca"
Using PushButton, the button generates single, double, and triple click events, even though the mouse clicks are seconds apart.
click 1 - EventClicked click 2 - EventMouseDoubleClick click 3 - EventMouseTripleClick click 4 - EventClicked click 5 - EventMouseDoubleClick click 6 - EventMouseTripleClick click 7 - EventClicked ...
I've tracked the problem down to an erroneous use of clock() in class SimpleTimer in CEGUISystem.cpp. clock() returns "the number of clock ticks of elapsed processor time"*, not elapsed wall clock time. My program sleeps while waiting for events (SDL_WaitEvent) and so does not use the processor between clicks, so clock returns the same number for different clicks and CEGUI thinks they were done very close in time. A proper implementation of SimpleTimer on Linux might use gettimeofday. On Windows clock() seems to work, but since reading the documentation tells us that clock() is not what we want it would be better to replace it with something like timeGetTime()
OS: Linux, OS build: , Platform: