[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squeak-dev
Subject:    [squeak-dev] Re: The Inbox: Morphic-ct.2126.mcz
From:       Marcel Taeumel via Squeak-dev <squeak-dev () lists ! squeakfoundation ! org>
Date:       2023-08-28 15:25:16
Message-ID: Mailbird-7d6cd900-1408-4a18-b52d-87bb6ef91e61 () hpi ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


+1 Thanks! Please go ahead and merge it.

Best,
Marcel
Am 26.08.2023 22:48:06 schrieb commits@source.squeak.org <commits@source.squeak.org>:
Christoph Thiede uploaded a new version of Morphic to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.2126.mcz

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

Name: Morphic-ct.2126
Author: ct
Time: 26 August 2023, 10:47:41.051023 pm
UUID: fd9b4398-075b-8c40-b1a8-8997341cf46a
Ancestors: Morphic-mt.2125

Fixes invalid state in text morphs when selecting text while something (e.g., a \
transcript) is updating the text.

E.g., you could trigger a nil errorNotIndexable from \
SmalltalkEditor(TextEditor)>>isDisjointFrom:) by doing this:

[[1 second wait.
Transcript showln: DateAndTime now] repeat] forkAt: Processor userBackgroundPriority.
"Drag to select text, wait for the next update, and release the cursor outside the \
window"

Make sure not to have any stepping morphs (such as browsers) in the world to \
reproduce this. #forceScreen does not need to be enabled.

Note that this is not a concurrency issue but also occurs when writing to the \
transcript from the UI process only. In general, you should not manipulate (or even \
access?) morphic UI state from other processes.

=============== Diff against Morphic-mt.2125 ===============

Item was changed:
----- Method: TextEditor>>mouseUp: (in category 'events') -----
mouseUp: evt
"An attempt to break up the old processRedButton code into threee phases"

"0) Click on text actions."
(self mouseUpOnTextAction: evt) ifTrue: [^ self].

"1) A 'double-click' will result in selecting the whole word."
(self hasCaret and: [oldInterval = self selectionInterval])
ifTrue: [self selectWord].

"2) For the next type-in, configure emphasis. We don't want to do this on
every key-press for performance reasons."
self setEmphasisHere.

"3) Notice selection changes."
+ (oldInterval notNil "happens if the editor has been replaced since mouseDown: \
(e.g., by a programmatic text change such as #appendEntry)" + and: [self \
isDisjointFrom: oldInterval]) + ifTrue: [otherInterval := oldInterval].
- (self isDisjointFrom: oldInterval)
- ifTrue: [otherInterval := oldInterval].
self storeSelectionInParagraph.

"4) Reset mouse cursor to account for selection changes."
self updateCursorForEvent: evt.
morph removeProperty: #waitingForTextDrag.!


[Attachment #5 (text/html)]

<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: \
Arial;color: #000000;text-align: left" dir="ltr">  +1 Thanks! Please go ahead and \
merge it.<div><br></div><div>Best,</div><div>Marcel</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 \
26.08.2023 22:48:06 schrieb commits@source.squeak.org \
&lt;commits@source.squeak.org&gt;:</p><div \
style='font-family:Arial,Helvetica,sans-serif'>Christoph Thiede uploaded a new \
version of Morphic to project The Inbox: \
<br>http://source.squeak.org/inbox/Morphic-ct.2126.mcz <br>
<br>==================== Summary ====================
<br>
<br>Name: Morphic-ct.2126
<br>Author: ct
<br>Time: 26 August 2023, 10:47:41.051023 pm
<br>UUID: fd9b4398-075b-8c40-b1a8-8997341cf46a
<br>Ancestors: Morphic-mt.2125
<br>
<br>Fixes invalid state in text morphs when selecting text while something (e.g., a \
transcript) is updating the text. <br>
<br>E.g., you could trigger a nil errorNotIndexable from \
SmalltalkEditor(TextEditor)>>isDisjointFrom:) by doing this: <br>
<br>	[[1 second wait.
<br>	Transcript showln: DateAndTime now] repeat] forkAt: Processor \
userBackgroundPriority. <br>	"Drag to select text, wait for the next update, and \
release the cursor outside the window" <br>
<br>Make sure not to have any stepping morphs (such as browsers) in the world to \
reproduce this. #forceScreen does not need to be enabled. <br>
<br>Note that this is not a concurrency issue but also occurs when writing to the \
transcript from the UI process only. In general, you should not manipulate (or even \
access?) morphic UI state from other processes. <br>
<br>=============== Diff against Morphic-mt.2125 ===============
<br>
<br>Item was changed:
<br>  ----- Method: TextEditor>>mouseUp: (in category 'events') -----
<br>  mouseUp: evt
<br>  	"An attempt to break up the old processRedButton code into threee phases"
<br>  
<br>  	"0) Click on text actions."
<br>  	(self mouseUpOnTextAction: evt) ifTrue: [^ self].
<br>  
<br>  	"1) A 'double-click' will result in selecting the whole word."
<br>  	(self hasCaret and: [oldInterval = self selectionInterval])
<br>  		ifTrue: [self selectWord].
<br>  	
<br>  	"2) For the next type-in, configure emphasis. We don't want to do this on
<br>  	every key-press for performance reasons."
<br>  	self setEmphasisHere.
<br>  	
<br>  	"3) Notice selection changes."
<br>+ 	(oldInterval notNil "happens if the editor has been replaced since mouseDown: \
(e.g., by a programmatic text change such as #appendEntry)" <br>+ 		and: [self \
isDisjointFrom: oldInterval]) <br>+ 			ifTrue: [otherInterval := oldInterval].
<br>- 	(self isDisjointFrom: oldInterval) 
<br>- 		ifTrue: [otherInterval := oldInterval].
<br>  	self storeSelectionInParagraph.
<br>  
<br>  	"4) Reset mouse cursor to account for selection changes."
<br>  	self updateCursorForEvent: evt.
<br>  	morph removeProperty: #waitingForTextDrag.!
<br>
<br>
<br></div></blockquote>
                                        </div></body>





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic