[squeak-dev] The Trunk: ST80-mt.258.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Thu Sep 17 11:06:52 UTC 2020


Hi Eliot.

> inside Controller>>processDeferredActions and have Controller>>controlActivity read

This would produce an endless recursion. But one could check with #== to avoid that. :-)

> Shouldn’t there in fact be a single SharedQueue for deferred actions?

Agreed. This would be a next step, now that we can see that this is actually happening. Might have been by accident so far.

 > Is this bug in Morphic too?

No, in Morphic, there is only single queue for all Morphic projects. It's a class variable in WorldState.

Best,
Marcel
Am 17.09.2020 12:56:30 schrieb Eliot Miranda <eliot.miranda at gmail.com>:
Hi Marcel,

> On Sep 17, 2020, at 12:15 AM, commits at source.squeak.org wrote:
>
> Marcel Taeumel uploaded a new version of ST80 to project The Trunk:
> http://source.squeak.org/trunk/ST80-mt.258.mcz
>
> ==================== Summary ====================
>
> Name: ST80-mt.258
> Author: mt
> Time: 17 September 2020, 9:15:53.534726 am
> UUID: c7ff9de0-a71a-4646-a639-211d94848498
> Ancestors: ST80-mt.257
>
> Fixes processing of deferred actions in MVC.
>
> Note that windows in MVC delegate control to their sub-controllers, however, remaining the active controller from the project's world perspective (i.e. the controller manager). Thus, we have to process two deferred-action queues in for most cases. For example, the text field in a workspace involves a PluggableTextController, embedded in a StandardSystemController. Any do-it like "Project current addDeferredUIMessage: [...]" will add the message to the StandardSystemController's queue.
>
> =============== Diff against ST80-mt.257 ===============
>
> Item was changed:
> ----- Method: Controller>>controlActivity (in category 'control defaults') -----
> controlActivity
> "Pass control to the next control level (that is, to the Controller of a
> subView of the receiver's view) if possible. It is sent by
> Controller|controlLoop each time through the main control loop. It should
> be redefined in a subclass if some other action is needed."
>
> + self processDeferredActions.
> + Project current world activeController processDeferredActions.
> - [self deferredActionQueue isEmpty]
> - whileFalse: [deferredActionQueue next value].
> self controlToNextLevel!
>
> Item was added:
> + ----- Method: Controller>>processDeferredActions (in category 'control defaults') -----
> + processDeferredActions
> +
> + [self deferredActionQueue isEmpty]
> + whileFalse: [deferredActionQueue next value].!
>
> Item was changed:
> ----- Method: ParagraphEditor>>normalActivity (in category 'controlling') -----
> normalActivity
> self processKeyboard.
> + self processMouseButtons.
> + super normalActivity.
> + !
> - self processMouseButtons!

first regarding the fix, wouldn’t it make more sense to put

Project current world activeController processDeferredActions.

inside Controller>>processDeferredActions and have Controller>>controlActivity read

Controller|controlLoop each time through the main control loop. It should
be redefined in a subclass if some other action is needed."

self processDeferredActions.
self controlToNextLevel

?

Second, doesn’t the two queue solution introduce a serious bug? Doesn’t it reorder deferred actions depending on which queue the action gets added to? Shouldn’t there in fact be a single SharedQueue for deferred actions? Is this bug in Morphic too?

_,,,^..^,,,_ (phone)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200917/0d297c64/attachment.html>


More information about the Squeak-dev mailing list