see also: http://forum.jogamp.org/NEWT-blocks-SWT-Thread-td4027270.html It seems to be that the NEWT windows blocks the SWT Thread. under https://bitbucket.org/sgratzl/jogltest there is a litte test setup based on 2.0-rc11 the project testjogl3 contains two classes. The first one uses a SWT GLCanvas to render the triangle the other one the NEWT Canvas / Window. In both classes a SWT messagebox should appear as soon as the glcontext is initialized, using Display.asyncExec. However only the SWT test case will open the popup, whereas the NEWT test case blocks the SWT thread and after the NEWT window is closed the Messagebox (would) appear.
As described w/ the title change, the
display.asyncExec(Runnable runnable) enqueues the runnable for later execution on the SWT UI thread. SWT's impl. shall execute the runnables at display.readAndDispatch(). On Windows, this is performed either while not having anymore native events to dispatch, or if executing these runnables is allowed w/ native event dispatching (disabled per default). Processing the runnables is done in Display/Synchronizer: runAsyncMessages(..). NewtCanvasSWT does not block SWT's dispatching, however none of these runnables gets processed. The reason is unknown and under investigation.
<http://jogamp.org/git/?p=jogl.git;a=commit;h=0bb202f2883e1eb82256140f13310046f7b13c62> Bug628: Adding unit-test 'TestNewtCanvasSWTBug628ResizeDeadlock' exposing NewtCanvasSWT asyncExec(..) bug w/ native parenting The unit test shows, that while using JOGL's SWT GLCanvas Display's asyncExec(..) works properly, but w/ NewtCanvasSWT on Windows does not. NewtCanvasSWT differs w/: - Using native parenting [Newt GLWindow to SWT Canvas] - Processing native events in own NEWT EDT, w/ own Windows dispatch hook [For the child GLWindow only]
Should read: Bug643 - not - Bug628
Fixed .. <http://jogamp.org/git/?p=jogl.git;a=commit;h=f0f58e120817b57ed3fb70c238001579a68e4064> Fix Bug 643: SWT 'display.asyncExec(Runnable runnable)' runnable not executed on Windows Turns out that the NEWT Windows impl. didn't properly validated the client region @ WM_PAINT and hence 'exhausted' the message pipeline, i.e. never reached an IDLE state. The latter caused SWT to never reach a point where deferred asyncExec(..) Runnables got processed. Besides this SWT effect, this also caused a NEWT window on Windows to always repaint itself (?). +++ <http://jogamp.org/git/?p=jogl.git;a=commit;h=571c21df9310d043b08a4a72064617cbe6eee0fa> ... Enhance Bug 643 unit test: Also test NEWT EDT and pre-visible GLWindow.