AROS icon indicating copy to clipboard operation
AROS copied to clipboard

Avoid doing datatype object layout twice

Open hth313 opened this issue 6 years ago • 1 comments

I could be wrong on this according to the comment, but I think the comment (which is removed in this commit) is confusing. The first part of the comment indicate it should be called once more (for what reason I do not know), and then it goes on about "unless there's another request to restart it", which seems out of place with the code.

There should be no reason to perform the layout twice, and doing it once seems to work with multiview, I tried with both a .png and a .guide file. I added some trace in my copy and it does the layout twice before and once after this change.

I suggest doing the layout only once.

The code works by having this process doing the layout, which can stop early on ctrl-c. This is done by another call to DoAsyncLayout before the layout is done. This sends the ctrl-c and sets the DTSIF_NEWSIZE flag to cause the process to restart the layout.

Note: There was a fix 4 years that introduced this behaviour. That fix also correctly added the semaphore and ctrl-c reset which I think were real bugs. If this double call really was needed at that time, then my guess is that it patched a symptom of anther problem. There should be no valid reason to call layout twice every time.

Anyway, have a look and think a bit about it.

hth313 avatar Jun 26 '19 21:06 hth313

This behavior needs to be confirmed against AmigaOS.

Kalamatee avatar Nov 03 '19 02:11 Kalamatee

Calling it twice is the correct behaviour. The method is called until it no longer has to adjust its size -> it has finished laying out. If it is not called a second time, you can not know if the datatype needs further laying out to properly fit.

Kalamatee avatar May 16 '23 21:05 Kalamatee