<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I first tested the sync change, but that don’t work, the program only show a white screen.<div class=""><br class=""></div><div class="">Using your code I put a breakpoint in the dispatch_sync and tested for a few minutes, but the breakpoint don’t activate, so I suppose the call is always in the main thread.</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 26, 2015, at 19:48, John McIntosh &lt;<a href="mailto:johnmci@smalltalkconsulting.com" class="">johnmci@smalltalkconsulting.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Ok, I have to look at this, the issue is: Is the thread on the background thread or the main thread. I suspect a thread check &nbsp;isMainThread is needed. If so then queue the draw. Otherwise do the draw request. I note that this only tells the UIKit to ask the view controllers to draw *later* That would occur next time thru the main event loop.&nbsp;<div class="">&nbsp;</div><div class="">try this and see what happens.&nbsp;</div><div class=""><br class=""></div>if ([NSThread isMainThread]) {<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [[self getMainView] drawThelayers];<br class="">} else {<br class="">dispatch_sync(dispatch_get_main_queue(), ^{ &nbsp; //note try sync not async, I wonder if that would be an issue?<br class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [[self getMainView] drawThelayers];<br class="">&nbsp; &nbsp;});<br class="">}<br class=""><br class="">Note the old code was<br class=""><br class="">if ([NSThread isMainThread]) <br class="">[[self getMainView] drawThelayers];<br class="">else {<br class="">[[self getMainView] performSelectorOnMainThread: @selector(drawThelayers) withObject: nil waitUntilDone: NO];<br class="">}</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Oct 26, 2015 at 10:09 AM, Javier Diaz-Reinoso <span dir="ltr" class="">&lt;<a href="mailto:javier_diaz_r@mac.com" target="_blank" class="">javier_diaz_r@mac.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="">
As i reported in the Squeak list I find a bug with dragging a morph and in PasteUpMorph&gt;&gt;flashRects:color:, I find the problem is with the implementation of DisplayScreen&gt;&gt;forceDisplayUpdate in the VM, specifically in ioForceDisplayUpdateActual in sqSqueakScreenAndWindow.m, the actual implementation call drawTheLayers using a queue:<br class="">
<br class="">
&nbsp; &nbsp; dispatch_async(dispatch_get_main_queue(), ^{<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [[self getMainView] drawThelayers];<br class="">
&nbsp; &nbsp;});<br class="">
<br class="">
I find this is unreliable, calling directly to drawTheLayers the bug is corrected, I believe that this is the correct operation because what you want is an immediate update otherwise the “timing” of the operation is lost, like in PasteUpMorph&gt;&gt;flashRects:color:, between the first and second call to copyBits are only 15 milliseconds, I suppose is the same with the drag of a morph.<br class="">
<br class="">
I don’t know if this change create new problems, appears to be working OK in an iPad2 (32 bits) and a iPad mini (64 bits).<br class="">
<br class="">
By the way I tested also using [SqueakUIViewOpenGL class] instead of [SqueakUIViewCALayer class] in whatRenderCanWeUse, that works OK in the iPad2 but create a small image in the iPad mini, I think is not taking into account the 2X of the retina display.</blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class="">===========================================================================<br class="">John M. McIntosh. Corporate Smalltalk Consulting Ltd&nbsp;<a href="https://www.linkedin.com/in/smalltalk" target="_blank" class="">https://www.linkedin.com/in/smalltalk</a><br class="">===========================================================================<br class=""></div></div></div></div>
</div>
</div></blockquote></div><br class=""></div></body></html>