[squeak-dev] The Inbox: Morphic-ct.1641.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Mon Jun 8 09:52:32 UTC 2020

Hi Christoph,

can you point me to the prior inbox artifacts and list discussions/comments about this "safe event processing"? I would really like to take a look at it. Having some safety net for broken #mouseOver: handlers similar to #displayWorldSafely: would really help debugging.

Am 07.06.2020 14:46:14 schrieb commits at source.squeak.org <commits at source.squeak.org>:
Christoph Thiede uploaded a new version of Morphic to project The Inbox:

==================== Summary ====================

Name: Morphic-ct.1641
Author: ct
Time: 7 June 2020, 2:45:17.536284 pm
UUID: b90e23e1-ce70-3d49-a8e4-f09af148ef97
Ancestors: Morphic-ct.1638

Refine #isHighFrequentEvent implementation for further event types. Fixes one possible cause of the "color depth = 0" bug. See http://forum.world.st/Image-not-startable-after-save-td5117084.html.

Depends indeed on Morphic-ct.1638.

=============== Diff against Morphic-ct.1638 ===============

Item was added:
+ ----- Method: DropEvent>>isHighFrequentEvent (in category 'testing') -----
+ isHighFrequentEvent
+ ^ false!

Item was added:
+ ----- Method: WindowEvent>>isHighFrequentEvent (in category 'testing') -----
+ isHighFrequentEvent
+ ^ (#(windowClose) includes: self type) not!

Item was changed:
----- Method: WorldState>>doSafely:onErrorThat:setErrorFlag:ifFatal:afterErrorDo: (in category 'update cycle') -----
doSafely: aBlock onErrorThat: errorPredicate setErrorFlag: errorFlag ifFatal: fatalErrorBlock afterErrorDo: postErrorBlock
"Evaluate aBlock and keep track of errors during morph invocations."

| finished classesWithErrors |
finished := false.
classesWithErrors := IdentitySet new.
[finished] whileFalse: [
[aBlock value. finished := true] on: Error, Halt, Warning do: [:ex |
| err rcvr errCtxt errMorph |
(errorPredicate cull: ex)
ifFalse: [ex pass].
err := ex description.
rcvr := ex receiver.

errCtxt := thisContext.
errCtxt := errCtxt sender.
"Search the sender chain to find the morph causing the problem"
[errCtxt notNil and: [(errCtxt receiver isMorph) not]]
whileTrue: [errCtxt := errCtxt sender].
"If we're at the root of the context chain then we have a fatal problem"
errCtxt ifNil: [^ fatalErrorBlock cull: err].
+ errMorph := errCtxt receiver
+ ] doWhileTrue: [
- errMorph := errCtxt receiver.
"If the morph causing the problem has already the error flag set, then search for the next morph above in the caller chain."
errMorph hasProperty: errorFlag
+ ].
- ] whileTrue.
setProperty: errorFlag toValue: true;

"Catch all errors, one for each receiver class."
(classesWithErrors includes: rcvr class) ifFalse: [
classesWithErrors add: rcvr class.
ToolSet debugException: ex].

postErrorBlock cull: err.

Item was changed:
----- Method: WorldState>>processEventsSafely: (in category 'update cycle') -----
processEventsSafely: aHandMorph

^ self
doSafely: [aHandMorph processEvents]
+ onErrorThat: [:error | self currentEvent ifNil: [true] ifNotNil: [:evt | evt isHighFrequentEvent]]
- onErrorThat: [:error | ActiveEvent isNil or: [ActiveEvent isHighFrequentEvent]]
setErrorFlag: #errorOnEvent
ifFatal: [:error | Project current fatalEventHandlingError: error]
afterErrorDo: []!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200608/1d9b7e62/attachment.html>

More information about the Squeak-dev mailing list