[Openmcl-devel] Issues with gui::new-cocoa-window after upgrade to 1.11

Paul Krueger plkrueger at comcast.net
Mon Mar 7 14:31:49 UTC 2016


On Mar 7, 2016, at 7:54 AM, R. Matthew Emerson <rme at clozure.com> wrote:
> 
> 
>> On Mar 4, 2016, at 1:39 AM, Edward Moore Geist <egeist at stanford.edu> wrote:
>> 
>> Greetings:
>> I had made a number of OpenGL demos using the CCL Cocoa IDE, and after upgrading to version 1.11-store-r16714 today I discovered that these no longer work correctly as they did in version 1.10. Windows made using the function gui::new-cocoa-window appear but the title and buttons do not display. Clicking where the buttons would be has the correct effect and the title appears as it should in menus/the Dock/etc. The demos using this function that come with CCL, such as rubix.lisp, have similar behavior. Does anyone have any insight into what might be causing this problem? Presumably there should be a workaround, since the Cocoa IDE itself works as intended.
> 
> Cocoa generally requires that all user interface related stuff happen on the main (initial) thread.
> 
> Evaluating (gui::execute-in-gui #'(lambda () (gui::new-cocoa-window ...))) should make a window that acts as expected.  The execute-in-gui function arranges for the passed-in function to be called on the main thread.
> 
> On older OS X versions, I think it worked to make windows from a non-main thread, but it doesn't any more.
> 

Absolutely correct. I discovered the same thing with my cocoa contrib code recently after upgrading to El Capitan. I suspect that this is the result of increasing internal use of Apple’s constraint mechanism, which I discovered several releases ago does require execution on the main thread. 

There will be several bug fixes coming for my code as a result (as well as some new things I’m working on). If anyone needs them before they are checked in, let me know. In my existing contrib code I have a macro wrapper for the underlying CCL code that Matthew referenced that is of the form: (on-main-thread <forms to execute>). Using that when in doubt fixes most of the bugs in my current code.


More information about the Openmcl-devel mailing list