Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2938
Prior discussion on #2955; I've followed the design outline suggested by @mhsmith in #2955 (comment) and @freakboy3742 in #2955 (review).
I think I have this mostly cracked, but I'm currently stumped.
At the moment I haven't dug into how to update the tests/probes yet — I'm only "testing" by launching
toga-demo
and seeing what happens. Most of the time it works, and I see this:Log:
That's less than a quarter of the layout calculations done by the non-deferred behavior, which is 55.
However, sometimes (maybe one in five or six), the
SplitContainer
is smaller on the left side:The log is almost the same:
All the same layouts are being performed, in the same order. (Interestingly, while popping from the set of dirty widgets is "random", it appears to be deterministically the same every time.) But the
OptionContainer
andScrollContainer
aren't getting marked dirty as many times. Of course that doesn't matter in and of itself — presumably it's a matter of the events causing those refresh requests. I'm having trouble tracking those down; theseObjCMethod.__call__
andsend_message
layers in the debugger stack trace are pretty opaque.What I do know is that all of these refresh requests come, in the immediate sense, from
TogaSplitView.splitViewDidResizeViews_
. For the two always-present pairs as well as the first "ephemeral" pair, that's all I can make sense of — the rest is Objective C, and basic event loop stuff. However, for the last two pairs, behindsplitViewDidResizeViews_
in the stack isTogaSplitView.applySplit
.So it appears that when things go awry, it's because (somehow)
applySplit
isn't being called.PR Checklist: