Issue 698 in moose-technology: Mondrian does not properly raise MOElementSelection
Labels: Type-Defect Priority-High Component-Mondrian Milestone-4.6
New issue 698 by tudor.gi...(a)gmail.com: Mondrian does not properly raise
When in Glamour, often when selecting a Mondrian element does not populate
the selection because the MOCanvas does not raise MOElementSelection.
The reason for this seems to be a race condition due to changes in the
announcement framework. In the new announcement framework from Pharo 1.3,
the order of announcements is not guaranteed.
The issue seems to be due to the logic of the announcement:
(lastEnteredGraphElement isNil not and: [
(lastEnteredGraphElement class ~~ MORoot and: [
lastEnteredGraphElement isNotSelected ])])
selectionEvent := MOElementSelection event: anEvent on:
anEvent commandKeyPressed ifTrue: [ selectionEvent setAsMultiple ].
self announce: selectionEvent.
anEvent wasHandled: true.
^ self ].
Sometimes, "lastEnteredGraphElement isNotSelected" returns false because
somehow the element gets selected beforehand. This is most likely related
to the fact that the selection of a node actually happens by handling the
same MOElementSelection announcement:
anAnnouncement element isNil ifFalse: [
anAnnouncement element announcer announce: anAnnouncement ].
self announcer announce: anAnnouncement.
self interaction on: MOElementSelection
do: [:ann |
ifTrue: [ self root allSelectedNodes
do: [ :node |
announce: (MOElementDeselection new) ] ].
ann element select.
self updateWindow ].