[Pkg] The Trunk: Morphic-mt.1575.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Oct 15 11:30:30 UTC 2019


Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1575.mcz

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

Name: Morphic-mt.1575
Author: mt
Time: 15 October 2019, 1:30:24.148785 pm
UUID: c7bde074-ddad-864a-a5b3-8b078736fe2f
Ancestors: Morphic-mt.1574

More robustness: (1) Catch both Error and Halt in Morphic drawing and (2) Reset drawing errors in morphs when restoring the Display.

=============== Diff against Morphic-mt.1574 ===============

Item was added:
+ ----- Method: MorphicProject>>restoreDisplay (in category 'scheduling & debugging') -----
+ restoreDisplay
+ 	"Give all morphs a chance to draw again."
+ 	self world ifNotNil: [:w | w allMorphsDo: [:ea | ea removeProperty: #errorOnDraw ]].
+ 
+ 	super restoreDisplay.!

Item was changed:
  ----- Method: WorldState>>displayWorldSafely: (in category 'update cycle') -----
  displayWorldSafely: aWorld
  	"Update this world's display and keep track of errors during draw methods."
  
  	| finished classesWithErrors |
  	finished := false.
  	
  	[finished] whileFalse: [
+ 		[aWorld displayWorld. finished := true] on: Error, Halt do: [:ex |
- 		[aWorld displayWorld. finished := true] on: Error do: [:ex |
  			"Handle a drawing error"
  			| err rcvr errCtx errMorph |
  			err := ex description.
  			rcvr := ex receiver.
  
  			errCtx := thisContext.
  			[
  				errCtx := errCtx sender.
  				"Search the sender chain to find the morph causing the problem"
  				[errCtx notNil and:[(errCtx receiver isMorph) not]] 
  					whileTrue:[errCtx := errCtx sender].
  				"If we're at the root of the context chain then we have a fatal drawing problem"
  				errCtx ifNil:[^Project current fatalDrawingError: err].
  				errMorph := errCtx receiver.
  				"If the morph causing the problem has already the #drawError flag set,
  				then search for the next morph above in the caller chain."
  				errMorph hasProperty: #errorOnDraw
  			] whileTrue.
  			errMorph setProperty: #errorOnDraw toValue: true.
  
  			"Catch all errors, one for each receiver class."
  			classesWithErrors ifNil: [classesWithErrors := IdentitySet new].
  			(classesWithErrors includes: rcvr class) ifFalse: [
  				classesWithErrors add: rcvr class.
  				ToolSet debugException: ex].
  
  			"Repaint all to catch all errors now and not if the debugger will appear."
  			aWorld fullRepaintNeeded.
  		]].!



More information about the Packages mailing list