<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Marcel,</p>
<p><br>
</p>
<p>didn't you handle the same edge case when you edited this method the latest time? I think the screenshot shared in my previous post is a really ugly think, and depending on your image speed, you have to look at it for a quite long time. I do not want to
 see this again in my image ...<br>
</p>
<p>However, if you know any more elegant way to fix the problem, I'll be glad to apply your suggestions. I think the changes are quite small because the list variable is a private detail and only accessed in two methods in total.</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">
<div class="_rp_U4 ms-font-weight-regular ms-font-color-neutralDark rpHighlightAllClass rpHighlightBodyClass" id="Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel<br>
<b>Gesendet:</b> Mittwoch, 7. Oktober 2020 09:19:05<br>
<b>An:</b> squeak-dev<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: Morphic-ct.1690.mcz</font>
<div> </div>
</div>
<div>
<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
Hi Christoph.
<div><br>
</div>
<div>> <span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">However, in some cases the list morph is redrawn while the #getList operation is being performed ...</span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br>
</span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Not sure whether such cases are worth addressing as they tend to blow up implementations rather quickly. There is *a lot* of code in Squeak/Morphic that is either non re-entrant or
 non transactional.</span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br>
</span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">One solution could be to exclusively draw the system progress bar. But this could lead to other small visual glitches.</span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br>
</span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">-1 on this one bc. it complicates the implementation (list can now be #locked, extra inst var) to cure a rare visual glitch</span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br>
</span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Best,</span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Marcel</span></div>
<div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;">
<p style="color: #AAAAAA; margin-top: 10px;">Am 01.10.2020 02:42:35 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p>
<div style="font-family:Arial,Helvetica,sans-serif">A new version of Morphic was added to project The Inbox:<br>
http://source.squeak.org/inbox/Morphic-ct.1690.mcz<br>
<br>
==================== Summary ====================<br>
<br>
Name: Morphic-ct.1690<br>
Author: ct<br>
Time: 1 October 2020, 2:42:17.443188 am<br>
UUID: 58a1128e-5547-4236-bc03-0c1f1366bb7b<br>
Ancestors: Morphic-eem.1686<br>
<br>
Fixes display invalidation in PluggableListMorph when displayed during updating the list contents.<br>
<br>
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.<br>
<br>
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).<br>
<br>
=============== Diff against Morphic-eem.1686 ===============<br>
<br>
Item was changed:<br>
ScrollPane subclass: #PluggableListMorph<br>
+ 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'<br>
- instanceVariableNames: 'list fullList modelToView viewToModel getListSelector getListSizeSelector getListElementSelector getIndexSelector setIndexSelector keystrokeActionSelector autoDeselect lastKeystrokeTime lastKeystrokes lastClickTime doubleClickSelector
 handlesBasicKeys potentialDropRow hoverRow listMorph keystrokePreviewSelector priorSelection getIconSelector getHelpSelector'<br>
classVariableNames: 'ClearFilterAutomatically ClearFilterDelay FilterableLists FlashOnErrors HighlightHoveredRow HighlightPreSelection MenuRequestUpdatesSelection'<br>
poolDictionaries: ''<br>
category: 'Morphic-Pluggable Widgets'!<br>
<br>
!PluggableListMorph commentStamp: 'mt 10/12/2019 11:04' prior: 0!<br>
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.<br>
<br>
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.<br>
<br>
Special keys (arrow up/down, page up/down, home, end) are also supported.!<br>
<br>
Item was changed:<br>
----- Method: PluggableListMorph>>getList (in category 'model access - cached') -----<br>
getList<br>
+ "Answer the (maybe filtered) list to be displayed. Cached result, see #updateList. If the list needs to be updated, do this atomically."<br>
+ <br>
+ list = #locked ifTrue: [<br>
+ "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."<br>
+ ^ previousStableList ifNil: #()].<br>
- "Answer the (maybe filtered) list to be displayed. Cached result, see #updateList."<br>
- <br>
^ list ifNil: [<br>
+ list := #locked.<br>
- 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."<br>
list := self filterableList<br>
ifTrue: [self getFilteredList]<br>
ifFalse: [self getFullList].<br>
self updateListMorph.<br>
list]!<br>
<br>
Item was changed:<br>
----- Method: PluggableListMorph>>updateListFilter (in category 'updating') -----<br>
updateListFilter<br>
<br>
| selection |<br>
selection := self selectionIndex = 0 "Avoid fetching #getList here."<br>
ifTrue: [nil]<br>
ifFalse: [self selection].<br>
<br>
+ previousStableList := list.<br>
+ [list := nil.<br>
- list := nil.<br>
modelToView := Dictionary new.<br>
viewToModel := Dictionary new.<br>
<br>
+ self getList] ensure: [<br>
+ list ifNil: [list := previousStableList].<br>
+ previousStableList := nil].<br>
- self getList.<br>
<br>
"Try to restore the last selection."<br>
selection ifNotNil: [self selection: selection].!<br>
<br>
<br>
</div>
</blockquote>
</div>
</div>
</body>
</html>