--- Peace Jerome peace_the_dreamer@yahoo.com wrote:
--- ned@squeakland.org wrote:
"Change Set: SecondClickTimeoutFix-nk Date: 26 July 2004 Author: Ned Konz
Fixes two problems in MouseClickState:
- down/up/down/wait would generate an incorrect
doubleClick.
- down/up/down/move would not generate startDrag
Also corrects and clarifies the MouseClickState-related comments in HandMorph.
Also corrects the balloonText instructions in DoubleClickExample. "
Thanks for taking the time to respond. I tried out your fixes and things seem to be better. I'm still looking over the code trying to puzzle out all that it does and all its ramifications. I just realized MouseClickState>>handleEvent:from: is recursive in that it sends HandMorph>>handleEvent which has a sent to .... I haven't gone thru the logic but I bet it would be interesting to see a history of what events pass thru ClickState.
Cheers and joy, --Jer
Well, I finished diagraming the logic yesterday. And it sure looked like clickstate was calling itself recursively with a second mouse up. Checking eventstats showed that mouseups were exceding mouse downs when DoubleClickExample was doodled and not very much otherwise.
So I wrote a investigator subclass to show the event history and got these results:
2: a WizClickState[#secondClickDown] clickClient: a DoubleClickExample<DoubleClick>(2653) clickState: #secondClickDown firstClickDown: [869@245 mouseDown red 2333079] firstClickUp: [869@245 mouseUp 2333169] firstClickTime: 2333079 clickSelector: #click: dblClickSelector: #doubleClick: dblClickTime: 350 dblClickTimeoutSelector: #doubleClickTimeout: dragSelector: #startDrag: dragThreshold: 10 history: an OrderedCollection() 1: [869@245 869@245 mouseMove red 2333097] 2: [869@245 869@245 mouseMove red 2333117] 3: [869@245 869@245 mouseMove red 2333137] 4: [869@245 869@245 mouseMove red 2333157]
5: [869@245 mouseUp 2333169] 6: [869@245 mouseUp 2333169]
7: [869@245 mouseDown red 2333191] 8: [869@245 869@245 mouseMove red 2333237] 9: [869@245 869@245 mouseMove red 2333257] 10: [869@245 869@245 mouseMove red 2333277] 11: [869@245 869@245 mouseMove red 2333297] 12: [869@245 mouseUp 2333301]
history is all the events going thru one clickstate from inseption til reset. I've isolated the duplicated mouse down caused by the recursive call to handleEvent:.
I've won my first bet. My second is that this is a significant bug explaining many other symptoms.
Attached is a changeset with the subclass to collect the history and clickstates. The above example is taken from a fresh image with just your changes added (and the look tools of course.)
The tools don't depend on specific methods in MouseClickState. So the can be added to before or after your most recent fixes.
I didn't have time to house train them completely. I was more interested in getting the debugging info. To turn them off completely revert the method that subsitutes the subclass for MouseClickState.
'From Squeak3.8alpha of ''17 July 2004'' [latest update: #5976] on 29 July 2004 at 10:30:54 am'! "Change Set: ClickTestTools-wiz Date: 29 July 2004 Author: Jerome Peace (wiz)
Third attempt. wiz 7/29/2004 10:29 Added a size limit to PastHistory. No sense causing out of space crashes.
Second attempt at ClickTestTools.
This is a first pass at tools to examine MouseClickState.
I made a nosy subclass of MouseClickState which copys the events as they are sent to a history collection.
The state's objects themselves are preserved in a classVar ordered collection with the idea of them being explored and reset.
Other than that I modified Double Cllick Example to implement the timeout selector. It cycles trough several border sizes.
And created sub instances to test varioius combinations of selectors since the behavior of clickstate differs depending on their presence or not.
HandMorph class was modified to give access to the eventStats that handleEvent stores.
HandMorph was modified to use and preserve my clickstate subclass. "!
Gzip cs (to which the above is a preamble) attached.
Yours in Service, Jerome Peace
__________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail
squeak-dev@lists.squeakfoundation.org