Closed funkey closed 8 years ago
Hmm... Could you try to get it to happen in a debugger, and then see what happens in https://github.com/scijava/ui-behaviour/blob/master/src/main/java/org/scijava/ui/behaviour/MouseAndKeyHandler.java#L317-L345 ?
Sure, of course.
I found that all scroll BehaviourEntry
s appeared twice in the list scrolls
when it happens. I suspect that in updateInternalMaps()
a scrolls.clear();
is missing.
However, I wonder why it happens only sometimes. updateInternalMaps()
is only called from update()
, which is synchronized
. So in some cases, between two calls to update()
, the modification counts change. Not so surprising, since update()
is triggered by AWT Events, and they come asynchronously and depend on what the user is doing with the mouse/keyboard during the initialization.
Yes, awesome! That's it, good catch.
Your explanation is right, I think. It depends on whether update()
is called already before the input/behaviourMaps have "settled".
I'll fix it and release a new version.
I released ui-behaviour 1,0.5. Thanks again for finding this @funkey
You're welcome, and thanks for the quick fix!
In rare cases, the ScrollBehaviour gets into a state where it emits two scroll events for every mouse wheel event. Unfortunately, this is difficult to reproduce. If it happens, it happens right from the start of the application and stays like that.
Observed in TranslateZController.