Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Cocoa SWT_AWT issues, and a new API proposal

On Sep 21, 2009, at 7:22 AM, Silenio Quarti wrote:

> I believe that detecting if  TransformProcessType()needs be called  
> should be done as this bug describes.
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=268687

I agree, though that's a separate problem from what I was running into  
here.  In this case, we weren't calling TransformProcessType() because  
NSApplication.isRunning() returned true, but the AWT did not call it  
either because it detected that the app was started from thread 0.  I  
wrote AWT startup to do the bare minimum if -XstartOnFirstThread was  
detected on the assumption that the SWT would be used.

I can work on detecting whether or not TPT should be called, though.   
I had to make a similar change to the Carbon SWT for Flash Catalyst to  
work around a related problem.

> As for documenting the rules, we can add something on the SWT FAQ or  
> to the java doc of SWT_AWT.java. It seems that we should not support  
> the case where the app is started without the -XstartOnFirstThread  
> option.

Can you clarify a bit?  SWT_AWT should not support it or Display  
should not support being created off the main thread?

-- Scott

> > A few notes: display is created in the main method, as recommended
> > by SWT. The Swing UI is created in the EDT, as recommended by AWT/
> > Swing.
>
> Are these kinds of rules documented anywhere?  If devs "follow the
> rules" as defined in this example, I don't have to make that many
> changes to Shell or Display, except to detect when the Shell doesn't
> own its window, as would be the case in the SWT_AWT new_Shell state.



Back to the top