We're having a problem regularly occur while running one of our applications. When a dialog is opened with a container list a walkback occurs sometimes the first time one of the items in the list is double clicked. We haven't been able to recreate it in development, but our users get this problem regularly.
Here's a snippet of one of the walkback logs:
ExceptionalEvent>>#signalWith:
receiver = Exception: (ExError) An error has occurred.
arg1 = 'Primitive failed in: Object>>#at: due to Index out of range in argument 1'
Array(Object)>>#error:
receiver = (nil nil nil)
arg1 = 'Primitive failed in: Object>>#at: due to Index out of range in argument 1'
Array(Object)>>#primitiveFailed:withArgument:backUp:
receiver = (nil nil nil)
arg1 = 2
arg2 = 1
arg3 = 1
Array(Object)>>#primitiveFailed
receiver = (nil nil nil)
Array(Object)>>#at:
receiver = (nil nil nil)
arg1 = 5
EwSingleSelectionMapper(EwListInputMapper)>>#doubleClickOccurred:
receiver = an EwSingleSelectionMapper
arg1 = CwButtonEvent[455,89] state=0 time=33782484 button=5
temp1 = nil
temp2 = nil
temp3 = nil
EwSingleSelectionMapper(EwListInputMapper)>>#processButtonPress:
receiver = an EwSingleSelectionMapper
arg1 = CwButtonEvent[455,89] state=0 time=33782484 button=5
EwSingleSelectionMapper(EwListInputMapper)>>#processInputEvent:
receiver = an EwSingleSelectionMapper
arg1 = CwButtonEvent[455,89] state=0 time=33782484 button=5
EwTableList(EwList)>>#inputEvent:clientData:callData:
receiver = an EwTableList
arg1 = CwDrawingArea('Container Details1_DrawingArea')
arg2 = nil
arg3 = CwButtonEvent[455,89] state=0 time=33782484 button=5
EwTableList(EwContainerList)>>#inputEvent:clientData:callData:
receiver = an EwTableList
arg1 = CwDrawingArea('Container Details1_DrawingArea')
arg2 = nil
arg3 = CwButtonEvent[455,89] state=0 time=33782484 button=5
EwTableList>>#inputEvent:clientData:callData:
receiver = an EwTableList
arg1 = CwDrawingArea('Container Details1_DrawingArea')
arg2 = nil
arg3 = CwButtonEvent[455,89] state=0 time=33782484 button=5
It looks like the Array called previousButtonDown is an empty Array when it shouldn't be since the user presumbly has clicked a button before getting into that method.
For now we've created a fix for this in the EwListInputMapper doubleClickOccurred: method.
Original
doubleClickOccurred: aCwButtonEvent
"Answer true if the button click described by aCwButtonEvent is close enough in time
and distance to the previous button click to be considered a double click event."
| previousClick answer distance |
previousClick := self previousButtonDown at: aCwButtonEvent button.
distance := self doubleClickDistanceThreshhold.
answer := previousClick == nil
ifTrue: [false]
ifFalse: [
(previousClick xRoot - aCwButtonEvent xRoot) abs < distance and: [
(previousClick yRoot - aCwButtonEvent yRoot) abs < distance and: [
aCwButtonEvent time - previousClick time <= self doubleClickMillisecondThreshhold and: [
(self widget itemAtX: aCwButtonEvent x y: aCwButtonEvent y) ~~ nil]]]].
self previousButtonDown
at: aCwButtonEvent button
put: (answer ifTrue: [nil] ifFalse: [aCwButtonEvent]).
^answer
Patch
doubleClickOccurred: aCwButtonEvent
"Answer true if the button click described by aCwButtonEvent is close enough in time
and distance to the previous button click to be considered a double click event."
| previousClick answer distance |
previousClick := self previousButtonDown at: aCwButtonEvent button ifAbsent: [].
distance := self doubleClickDistanceThreshhold.
answer := previousClick == nil
ifTrue: [false]
ifFalse: [
(previousClick xRoot - aCwButtonEvent xRoot) abs < distance and: [
(previousClick yRoot - aCwButtonEvent yRoot) abs < distance and: [
aCwButtonEvent time - previousClick time <= self doubleClickMillisecondThreshhold and: [
(self widget itemAtX: aCwButtonEvent x y: aCwButtonEvent y) ~~ nil]]]].
self previousButtonDown
at: aCwButtonEvent button
put: (answer ifTrue: [nil] ifFalse: [aCwButtonEvent]).
^answer
It would be nice if this fix could make it into the next release.