<div dir="ltr"><div dir="ltr">Hi Guille, Hi John, Hi All,<br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 30, 2018 at 2:10 PM Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Guille,<div><br></div><div>    I'm noticing some lock ups, primarily after resolution changes, or long periods of not in interacting.  I wonder whether there are a class of window events that the loop does not handle and if this produces a lock up, or rather a failure to notice that new events are incoming.  I *think* I have a reproducible case on a MacBookPro whose display resolution is set to "More Space" (see the Displays setting tab). </div><div>Have a VM running on the laptop screen while the laptop is connected to an Apple Cinema display (in this configuration the laptop's retina display reverts to its default resolution).</div><div>Then disconnect the cinema display, at which point the MBP's retina display's resolution changes back to :"More Space" and, at least when I tried this morning, the VM locked up.<br></div></div></blockquote><div><br></div><div>Guille, I think you're off the hook.  I edited the event loop to include:</div><div><br></div><div><div>        if (!(event.window == 0 || event.window == gDelegateApp.window)){</div><div>          printf("breaking with event.window = %lx (gDA.window = %lx)\n", event.window, gDelegateApp.window);</div><div>          break;</div><div>        }</div></div><div><br></div><div>but I see no print out when the lock up occurs.  John, here's how to reproduce a lock up on macOS 10.13, MacBookPro with retina display:</div><div><br></div><div>1. set the display resolution to Default</div><div>2. launch an image (Pharo or Squeak)</div><div>3. set the display resolution to "More Space"</div><div><br></div><div>the image now no longer receives events, and the main window is not resizable.  Restoring the display to Default does not unlock the system.</div><div><br></div><div>And the same lock up occurs in the opposite direction; set the resolution to "More Space", launch and change to "Default" and again the system, locks up.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>On Tue, Oct 23, 2018 at 2:08 AM Guillermo Polito <<a href="mailto:guillermopolito@gmail.com" target="_blank">guillermopolito@gmail.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> <div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>I see my first PR got integrated too fast. I've made a new one this morning that removes the guard and adds some comments in the code.</div><div><br></div>Also, answering the questions that arised in the PR, I believe this should have no effect on systems using a single window.<div>However, with multiple windowing systems, this (my patch) makes the consumption of events a cooperative task between the windowing systems.</div><div>For example, if we manage to have a SDL window open but SDL does not consume its events (because we don't call the event processing routine), then those events stay in the queue for ever.<br><br>I'm still not happy with the solution but I can deal with it right now, and it should not affect anybody else...<br><br>To make it more robust I've been trying to</div><div> - Use a separate queue to store "alien" events and then repost them in the queue afterwards (<a href="https://developer.apple.com/documentation/appkit/nsapplication/1428710-postevent?language=objc" target="_blank">https://developer.apple.com/documentation/appkit/nsapplication/1428710-postevent?language=objc</a>).</div><div>    But I could not manage to make it work yet, and Cocoa's support/documentation does really NOT help here... :)</div><div>- Maybe we can just discard "very old" events?<br></div><div><br></div><div>But on the other side this solution is maybe simple enough to do the job.<br></div><div><br></div><div>Comments are welcome ^^</div><div>Cheers,</div><div>Guille</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 22, 2018 at 3:16 PM Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> <div dir="auto">Hi Guille,<div dir="ltr"><br>On Oct 22, 2018, at 3:31 AM, Guillermo Polito <<a href="mailto:guillermopolito@gmail.com" target="_blank">guillermopolito@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"><span></span></div></blockquote><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi all,</div><div><br></div><div>While playing with SDL on OSX we have noticed that the main window in the VM is randomly eating events that belong to other windows. This happens because we are consuming events regardless the window they come from.</div><div><br></div><div>The corresponding code is in the method pumpRunLoopEventSendAndSignal: in</div><div>   <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/iOS/vm/OSX/sqSqueakOSXApplication%2Bevents.m" target="_blank">https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/iOS/vm/OSX/sqSqueakOSXApplication%2Bevents.m</a></div><div><br></div><div>I've playing around with making the VM consume only events that come from its own window or from no window (window=null).</div><div>This seems to work correctly, and I've had run into no issues in the last couple of hours.</div><div><br></div><div>I've also prepared a PR with the associated changes in here: <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295" target="_blank">https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/295</a>.</div><div>I've put a guard so my code is only valid for PHAROVM builds, but I'd gladly remove the guards if people think this is a good move for all the community.<br></div></div></div></div></blockquote><div><br></div>Yes please!<div><br><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Thanks,</div><div>Guille</div><div dir="ltr" class="gmail-m_-2575977105035002814m_-5842672832419101784m_6541019413465310383gmail_signature"><div dir="ltr"><div></div></div></div></div></div>
</div></blockquote></div></div></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-2575977105035002814m_-5842672832419101784gmail_signature"><div dir="ltr"><div><div dir="ltr"><table cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr>
<td valign="top" style="width:86px;height:84px;border-style:solid;border-width:0px 1px 0px 0px;border-color:transparent rgb(0,0,0) transparent transparent;padding:4px">
<p style="margin:0px;min-height:14px"><font face="Helvetica" color="#000000" style="font-stretch:normal;font-size:10px;line-height:normal;font-family:Helvetica;color:rgb(0,0,0)"> </font><span style="font-family:Helvetica;font-size:10px"> </span><span style="font-family:Helvetica;font-size:10px"> </span><img src="https://www.cristal.univ-lille.fr//videos/presentation.jpg" width="200" height="112"><img src="https://intranet.cnrs.fr/Cnrs_pratique/communiquer/guides/PublishingImages/CNRS-filaire-Bichro-CMJN.jpg" alt="" style="font-size: 12.8px; margin: 5px;" width="96" height="96"></p>















</td><td valign="top" style="width:378px;height:84px;border-style:solid;border-width:0px 0px 0px 1px;border-color:transparent transparent transparent rgb(0,0,0);padding:4px"><p style="margin:0px"><font face="Helvetica" color="#000000" style="font-stretch:normal;font-size:10px;line-height:normal;font-family:Helvetica;color:rgb(0,0,0)">Guille Polito</font></p><p style="margin:0px"><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:10px">Research Engineer</span></p><p style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Helvetica;color:rgb(0,0,0);min-height:10px"><font></font></p><p style="margin:0px"><font face="Helvetica" color="#000000" style="font-stretch:normal;font-size:10px;line-height:normal;font-family:Helvetica;color:rgb(0,0,0)">Centre de Recherche en Informatique, Signal et Automatique de Lille</font></p><p style="margin:0px"><font face="Helvetica" color="#000000" style="font-stretch:normal;font-size:10px;line-height:normal;font-family:Helvetica;color:rgb(0,0,0)">CRIStAL - UMR 9189</font></p>
<p style="margin:0px"><font face="Helvetica" color="#000000" style="font-stretch:normal;font-size:10px;line-height:normal;font-family:Helvetica;color:rgb(0,0,0)">French National Center for Scientific Research - <font><u><a href="http://www.cnrs.fr" target="_blank">http://www.cnrs.fr</a></u></font></font></p><p style="margin:0px;font-stretch:normal;font-size:10px;line-height:normal;font-family:Helvetica;color:rgb(0,0,0);min-height:10px"><br></p>
<p style="margin:0px"><font face="Helvetica" color="#000000" style="font-stretch:normal;font-size:10px;line-height:normal;font-family:Helvetica;color:rgb(0,0,0)"><b>Web:</b> <a href="http://guillep.github.io" target="_blank"><font><u>http://guillep.github.io</u></font></a></font></p>
<p style="margin:0px"><font face="Helvetica" color="#000000" style="font-stretch:normal;font-size:10px;line-height:normal;font-family:Helvetica;color:rgb(0,0,0)"><b>Phone: </b>+33 06 52 70 66 13</font></p>
</td>
</tr>
</tbody>
</table></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-2575977105035002814gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></div>