Are there any examples which use the NewtCanvasAWT? If I create a Window and use it in the constructor for NewtCanvasAWT, then a 2ndScreen is allocated during the reparenting process. This occurs because isNativeWindowValid() returns false (the window isn't displayed yet), which throws off the reference counts used in Display. Enabling the debug for Display demonstrates the reference count is at 2.
I took a look at the junit tests and found that one of them locked up consistently. When I run all of the unit tests within TestParenting01aAWT, the test fails on testWindowParenting04ReparentNewtWin2TopLayouted. If I run just that one test independently, it seems to work fine.
NEWT looks pretty interesting, but it needs some work to make it more stable and predictable. Although the test cases complete without reporting errors, each leaves running non-daemon threads. This isn't a problem for an individual test, but if NEWT were part of a larger application It could definitely cause some issues.
Looking internally within the running instance, the Display reference counter is incorrect. The reference counter is used to determine when the Display's EDT is longer necessary. There is no finalize() method defined for screen, so it is have to have a Screen instance garbage collected without decrementing the reference count. NewtCanvasAWT consistently reparents the GLWindow instances, creating second screens, which explains why the reference count within the Display is incorrect.
I see tests using multiple windows, but I didn't see any tests that independently manage those windows. The tests construct the windows run a few operations, and then destroy the pair. Since I'm looking to operate within a JDesktopPane, being able to create and destroy a window without negatively impacting other windows is a requirement.