EwListInputMapper bug

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

EwListInputMapper bug

Postby schepurny » Thu Feb 14, 2008 11:15 am

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. :)
schepurny
 
Posts: 16
Joined: Tue Jan 15, 2008 10:23 am

Re: EwListInputMapper bug

Postby nmongeau » Thu Feb 14, 2008 1:14 pm

Your fix will work but the diagnostic is slightly wrong. Your array is not empty, it contains 3 elements (one for each mouse button, i.e. Button1, Button2 and Button3), but your event points to Button5. I don't know what mouse button this represents :-), but it's valid nonetheless (Button5 is defined in the CwConstants pool). Since portions of the stack are missing, I can't tell where the event originated from and why it contains Button5.

Normand
nmongeau
[|]
 
Posts: 29
Joined: Fri Jan 12, 2007 9:37 am

Re: EwListInputMapper bug

Postby schepurny » Fri Feb 15, 2008 4:02 am

Yes you're right, I misspoke on that one that it is actually an Array of 3 nil elements. I should also mention that this was on an AIX environment running Exceed. I have a potential theory that this problem is occurring because the button clicks are done slightly differently (in certain scenarios) under the AIX environment than the code handles. I will investigate more to see if I can gather more information on the underlying cause.
schepurny
 
Posts: 16
Joined: Tue Jan 15, 2008 10:23 am

Re: EwListInputMapper bug

Postby nmongeau » Sat Feb 16, 2008 7:20 am

Hmm, it just dawned on me that it's most likely a mouse that has side buttons. I don't have such a mouse, but it's worth checking to see if your users have them.

Norm
nmongeau
[|]
 
Posts: 29
Joined: Fri Jan 12, 2007 9:37 am

Re: EwListInputMapper bug

Postby wembley » Sun Feb 17, 2008 4:05 pm

Actually, buttons 4 and 5 are sent by the mousewheel on Unix. This problem is corrected in the next release.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC

Re: EwListInputMapper bug

Postby schepurny » Tue Feb 19, 2008 6:32 am

Thank you.

We have over 50 AIX client machines so this problem is significant. Is there any idea when the next release will be?
schepurny
 
Posts: 16
Joined: Tue Jan 15, 2008 10:23 am

Re: EwListInputMapper bug

Postby wembley » Tue Feb 19, 2008 7:20 am

John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest