Skip to content

Commit

Permalink
fixes #351
Browse files Browse the repository at this point in the history
  • Loading branch information
plantec committed Nov 10, 2023
1 parent abf84b7 commit 46006ca
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Bloc/BlSharedEventDistributor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,20 @@ BlSharedEventDistributor >> adjustPosition: aNewEvent from: anOldEvent [

{ #category : 'api - event managing' }
BlSharedEventDistributor >> dispatch: aBlEvent on: anElement [
| aNewEvent |

| aNewEvent |
shouldHandle ifFalse: [ ^ self ].

aNewEvent := aBlEvent newCopyFor: anElement.
aBlEvent isMouse ifTrue: [
self adjustPosition: aNewEvent from: aBlEvent ].

shouldHandle := false.
[ anElement dispatchEvent: aNewEvent ]
ensure: [ shouldHandle := true ]
[ anElement dispatchEvent: aNewEvent ] ensure: [
shouldHandle := true ].
"Update the original event correctly if the event copy is consumed.
This is necessary if event processing depends on #isConsumed (e.g. dnd processing)"
aNewEvent isConsumed ifTrue: [ aBlEvent consumed: true ]
]

{ #category : 'accessing' }
Expand Down

0 comments on commit 46006ca

Please sign in to comment.