Christoph Thiede uploaded a new version of Morphic to project The Trunk: http://source.squeak.org/trunk/Morphic-ct.2155.mcz
==================== Summary ====================
Name: Morphic-ct.2155 Author: ct Time: 3 May 2024, 6:24:46.710377 pm UUID: ea10ff8e-6579-4cd4-9131-d2af6e8a800a Ancestors: Morphic-mt.2152
Fixes halo transfer to morphs that overlap with another morph that overlaps with the current halo. This was a regression from Morphic-ct.1794.
=============== Diff against Morphic-mt.2152 ===============
Item was changed: ----- Method: MorphicHaloDispatcher>>dispatchHalo:createFor: (in category 'dispatching') ----- dispatchHalo: anEvent createFor: aContainer "Invoke a halo on any aContainer's submorph that wants it. Dispatch uses anEvent's #position. The dispatch only ends in that container if no other morph wants it. Note that the event's #shiftPressed state determines whether the dispatch goes innermost-to-outermost (if pressed) or the other way around (if not pressed). If there already is a halo, check whether the event still points into the same hierarchy. If it does, do nothing here but rely on the halo itself to process the event (see implementors of #transferHalo:from:). If, however, the event points to a different hierarchy in the container, invoke a new halo and discard the current one. We do this here because the current halo should not bother with its container but only its #target."
| stack innermost haloTarget | "The stack is the frontmost (i.e. innermost) to backmost (i.e. outermost) morph." stack := (aContainer morphsAt: anEvent position unlocked: true useFullBounds: true) select: [ : each | each wantsHaloFromClick or: [ each isRenderer ] ]. "self assert: [ stack last == aContainer ]." innermost := anEvent hand halo ifNil: [ stack first ] ifNotNil: [ : existingHalo | "self assert: [ existingHalo wantsHaloFromClick not ]. " stack + detect: [ : each | each owner == aContainer ] - detect: [ : each | each owner == aContainer - and: [ existingHalo bounds intersects: (existingHalo haloBoundsFor: each) ] ] ifFound: [ : topInContainer | "Is existingHalo's target part of the same topInContainer as the morph clicked?" (existingHalo target withAllOwners includes: topInContainer) ifTrue: [ "same hierarchy, let #transferHalo: continue to handle it for now." ^ false ] ifFalse: [ "different hierarchy, remove + add." anEvent hand removeHalo. anEvent shiftPressed ifTrue: [ stack first ] ifFalse: [ topInContainer ] ] ] ifNone: [ "existingHalo is on the World, defer to #transferHalo: for now." ^ false ] ].
"If modifier key is pressed, start at innermost (the target), otherwise the outermost (direct child of the world (self))." haloTarget := (innermost == aContainer or: [ anEvent shiftPressed ]) ifTrue: [ innermost ] ifFalse: [ "Find the outermost owner that wants it. Ignore containment above aContainer." stack := innermost withAllOwners. (stack first: (stack findFirst: [ : each | each owner == aContainer ])) reversed detect: [ : each | each wantsHaloFromClick or: [ each isRenderer ] ] ifNone: [ "haloTarget has its own mouseDown handler, don't halo." ^ false ] ]. "Now that we have the haloTarget, show the halo." self invokeHaloOrMove: anEvent on: haloTarget. ^ true!
packages@lists.squeakfoundation.org