Window Ordering Bug (Mac)

Open the juce demo, Mac OSX, "Windows" Demo

open -> all Windows, close the Dialog Box
position the right DocumentWindow over the left DocumentWindow (both over the main window), close the right one, the left one stays top.

right!
now again:

open -> all Windows, close the Dialog Box
position the left DocumentWindow over the right DocumentWindow (both over the main window), close the left one,  now the right one is behind the main window!

This makes  no sense in terms of the focus order, or creation time.
 

Should be fixed on newest tip. Thanks for reporting!

Thank you!