Created attachment 557 [details] Modified TestAWTCardLayoutAnimatorStartStopBug532 to demo artifect Our application switches between a GLCanvas to offer a 3D view and a several Swing JPanels to offer a various 2D views. For convenient switching, we use a CardLayout. We experience a problem with the painting of the Swing views when switching from GLCanvas to Swing. Directly after the GLCanvas is interchanged for a Swing JPanel, the Swing JPanel shows a flash of garbage (one frame) before drawing its proper content. Crudely put, it seems Swing realizes too late that a repaint is required. Few additional notes: * If we replace heavyweight GLCanvas with lightweight GLJPanel, then this refresh problem doesn't occur. * The problem occurs on Windows only, it seems. Reproduction: Attached a modified version of TestAWTCardLayoutAnimatorStartStopBug532. Each test goes from a JPanel with orange background, to GLCanvas, to a JPanel with blue background and again to GLCanvas. When the blue Jpanel is shown, a brief flash of orange can be seen. ---- Platform info: Short - see attached log for extended info. OS: Windows 7, 64 bits Java version: 1.7.0_45 Jogl: v2.1.2 tag OpenGL: 3.3.0 (Quadro FX 1800/PCIe/SSE2)
Created attachment 558 [details] Runtime Version Check
A tidbit of extra information: When replacing the lightweight JPanel with its heavyweight sibling Panel, the repaint problem does not occur.
I am afraid there is nothing we can do about this issue, i.e. heavy-/lightweight mixing issues. As you state, either go heavyweight Panel .. or use GLJPanel. Our other tests do not show anything special. Maybe I find time testing your code in a bit.
Hi Sven, Thank you for the reply. The light/heavyweight mixing is I'm sure indeed the root issue here. Strangely, if I replace the GLCanvas with a heavyweight java.awt.Canvas, the switch between heavy- and lightweight is without any refresh problems. Would you know of any aspect of GLCanvas that might cause the extra delay in refresh when compared to the heavyweight Canvas? We'd be happy to work around the problem if that's somehow possible. For now, we reduced the problem to a brief white flash during GLCanvas > Lightweight switch by embedding our lightweight panels in heavyweight Panels.
See comment 3 - No more AWT lightweight/heavyweight hacking ..