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

commits at source.squeak.org commits at source.squeak.org
Thu Oct 1 00:42:25 UTC 2020


A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1690.mcz

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

Name: Morphic-ct.1690
Author: ct
Time: 1 October 2020, 2:42:17.443188 am
UUID: 58a1128e-5547-4236-bc03-0c1f1366bb7b
Ancestors: Morphic-eem.1686

Fixes display invalidation in PluggableListMorph when displayed during updating the list contents.

To avoid recursive #getList sends, since Morphic-mt.1576, the list variable has been cleaned up before sending #getFullList/#getFilteredList. However, in some cases the list morph is redrawn while the #getList operation is being performed, for example if the model code shows a system progress bar (e.g. when loading/refreshing code in Monticello). In the past, this led to drawing artifacts during the list update.

To avoid these artifacts, this version implements the list update as an atomic operation by storing the previous list contents in the variable previousStableList while recomputing the list. In addition, if #getList is curtailed, the previous list contents are restored (which is especially helpful during debugging).

=============== Diff against Morphic-eem.1686 ===============

Item was changed:
  ScrollPane subclass: #PluggableListMorph
+ 	instanceVariableNames: 'list fullList modelToView viewToModel getListSelector getListSizeSelector getListElementSelector getIndexSelector setIndexSelector keystrokeActionSelector autoDeselect lastKeystrokeTime lastKeystrokes lastClickTime doubleClickSelector handlesBasicKeys potentialDropRow hoverRow listMorph keystrokePreviewSelector priorSelection getIconSelector getHelpSelector previousStableList'
- 	instanceVariableNames: 'list fullList modelToView viewToModel getListSelector getListSizeSelector getListElementSelector getIndexSelector setIndexSelector keystrokeActionSelector autoDeselect lastKeystrokeTime lastKeystrokes lastClickTime doubleClickSelector handlesBasicKeys potentialDropRow hoverRow listMorph keystrokePreviewSelector priorSelection getIconSelector getHelpSelector'
  	classVariableNames: 'ClearFilterAutomatically ClearFilterDelay FilterableLists FlashOnErrors HighlightHoveredRow HighlightPreSelection MenuRequestUpdatesSelection'
  	poolDictionaries: ''
  	category: 'Morphic-Pluggable Widgets'!
  
  !PluggableListMorph commentStamp: 'mt 10/12/2019 11:04' prior: 0!
  I am a list widget that uses the change/update mechanism to display model data as a vertical arrangement of (maybe formatted) strings and icons in a scroll pane.
  
  When I am in keyboard focus, type in a letter (or several letters quickly) to go to the next item that begins with that letter. If you enabled the "filterable lists" preference, I will hide all items that do not match the filter.
  
  Special keys (arrow up/down, page up/down, home, end) are also supported.!

Item was changed:
  ----- Method: PluggableListMorph>>getList (in category 'model access - cached') -----
  getList
+ 	"Answer the (maybe filtered) list to be displayed. Cached result, see #updateList. If the list needs to be updated, do this atomically."
+ 
+ 	list = #locked ifTrue: [
+ 		"The list is already being updated at the moment but needs to be accessed again during the update. To avoid recursion, the update is implemented as an atomic operation. This can happen, for example, when the model fetches data that opens the system progress bar which then will redraw periodically."
+ 		^ previousStableList ifNil: #()].
- 	"Answer the (maybe filtered) list to be displayed. Cached result, see #updateList."
- 	
  	^ list ifNil: [
+ 		list := #locked.
- 		list := #(). "To make this call safe when re-entering it while fetching the list. This can happen, for example, when the model fetches data that opens the system progress bar which then will redraw periodically."
  		list := self filterableList
  			ifTrue: [self getFilteredList]
  			ifFalse: [self getFullList].
  		self updateListMorph.
  		list]!

Item was changed:
  ----- Method: PluggableListMorph>>updateListFilter (in category 'updating') -----
  updateListFilter
  
  	| selection |
  	selection := self selectionIndex = 0 "Avoid fetching #getList here."
  		ifTrue: [nil]
  		ifFalse: [self selection].
  
+ 	previousStableList := list.
+ 	[list := nil.
- 	list := nil.
  	modelToView := Dictionary new.
  	viewToModel := Dictionary new.
  	
+ 	self getList] ensure: [
+ 		list ifNil: [list := previousStableList].
+ 		previousStableList := nil].
- 	self getList.
  	
  	"Try to restore the last selection."
  	selection ifNotNil: [self selection: selection].!



More information about the Squeak-dev mailing list