[Vm-dev] [win32] Morphic event timeStamp bug

Marcel Taeumel marcel.taeumel at student.hpi.uni-potsdam.de
Mon May 4 11:41:06 UTC 2015


Hi!

We identified a bug concerning either the #timeStamp in MorphicEvent objects
or Time >> #millisecondClockValue.

Inspecting the result of "ActiveEvent timeStamp - Time
millisecondClockValue" returns a suspiciously high number. 21373801 on my
last try.

So, the primitive 135, which is used for #millisecondClockValue, points
(cointerp.c) to ioMSecs(). For Windows this is "GetTickCount() &0x3FFFFFFF;"
(sqWin32Time.C).

Then, the keyboard event (here: CMD+P) gets its timeStamp assigned from the
MSG structure in sqWin32Window.c, which is good:

int recordKeyboardEvent(MSG *msg) {
...
evt->timeStamp = msg->time;
...
}

((( Only for drag/drop events into the VM, it uses ioMicroMSecs()
[cointerp.c], which is timeGetTime() and has a higher accuracy. )))

The MSDN says this:
MSG structure
https://msdn.microsoft.com/en-us/library/windows/desktop/ms644958%28v=vs.85%29.aspx
GetTickCount()
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724408%28v=vs.85%29.aspx
GetMessageTime()
https://msdn.microsoft.com/en-us/library/windows/desktop/ms644939%28v=vs.85%29.aspx

And some interesting discussions about msg->time vs. GetMessageTime() :
http://blogs.msdn.com/b/oldnewthing/archive/2014/01/22/10491576.aspx

Some ideas/questions:

- Why isn't the MillisecondClockMask applied to the message time as in
sqMacUIEvents.c ?
- Hmmmm....

Best,
Marcel & Bert



--
View this message in context: http://forum.world.st/win32-Morphic-event-timeStamp-bug-tp4824244.html
Sent from the Squeak VM mailing list archive at Nabble.com.


More information about the Vm-dev mailing list