JUCE OpenGL Demo: Child components get hidden and flicker

There's a JUCE bug (?) which can be seen in JuceDemo's OpenGL Demo - see screenshot:

Simply resize the window slightly and increase the size of the teapot - and it occasionally occludes the components above it (depending on its current rotation).

Not seen in the screenshot is that these components flicker (at least on OS X 10.11.3) and aren't constantly hidden. (can be seen if stopping the rotation in the right place)

Here's a suggested fix:


(to just disable depth_test when drawing the components layer)

Cheers, Yair

Update: while my fix worked for the JUCE Demo, it didn't preserve the GL_DEPTH_TEST mode.

Here's the second commit to make this fix complete (hopefully): https://github.com/soundradix/JUCE/commit/d29bb6d6647a963d5c024cb2363476011b081427

Thanks - will have a look at this today..