Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1180.mcz==================== Summary ====================
Name: Morphic-mt.1180
Author: mt
Time: 15 June 2016, 10:37:35.384378 am
UUID: 82bb6072-42a5-7d45-afb0-f324d6604079
Ancestors: Morphic-mt.1179
Fixes a regression with event filterung and bubbling in general, which affects events sent to morphs that are submorphs of the hand. Escaping drag-and-drop, for example, where events are sent to the TransferMorph.
=============== Diff against Morphic-mt.1179 ===============
Item was changed:
----- Method: Morph>>handleFocusEvent: (in category 'events-processing') -----
handleFocusEvent: anEvent
"Handle the given event. This message is sent if the receiver currently has the focus and is therefore receiving events directly from some hand.
1) Event bubbling. Do event bubbling known from MorphicEventDispatcher by calling #handleEvent: also on all owners.
2) Event capture filters. Walk along the owner chain in reverse order and apply capture filters as known from MorphicEventDispatcher.
If you want to overwrite this in a subclass (for example to implement modal dialogs) ensure to call super instead if #handleEvent: directly."
| filteredEvent |
filteredEvent := anEvent.
"TODO: Add a check to ensure that our event dispatcher is actually of kind MorphicEventDispatcher?!! We do copy its behavior though... like self defaultEventDispatcher class == MorphicEventDispatcher? Or #isKindOf:? Anyway, the outermost morph determines the event dispatcher. See HandMorph >> #sendEvent:focus:clear: and PasteUpMorph >> #processEvent:."
"Event capturing. Filters only because the capturing phase was bypassed by using the keyboard/mouse focus."
self withAllOwners reverseDo: [:morph | "reverse order to comply with default MorphEventDispatcher"
+ morph == anEvent hand ifFalse: [ "Fixes drag-and-drop bug."
+ filteredEvent := morph sendFilterEventCapture: filteredEvent for: morph.
+ filteredEvent wasIgnored ifTrue: [^ filteredEvent]]].
- filteredEvent := morph sendFilterEventCapture: filteredEvent for: morph.
- filteredEvent wasIgnored ifTrue: [^ filteredEvent]].
"Event bubbling. Filters are processed in #handleEvent:."
self withAllOwnersDo: [:morph |
+ morph == anEvent hand ifFalse: [ "Fixes drag-and-drop bug."
+ filteredEvent := morph handleEvent: filteredEvent.
+ filteredEvent wasIgnored ifTrue: [^ filteredEvent]]].
- filteredEvent := morph handleEvent: filteredEvent.
- filteredEvent wasIgnored ifTrue: [^ filteredEvent]].
^ filteredEvent!