There are many circumstances where a JUCE API call will destroy the ComponentPeer and recreate it. Some examples:
- Changing the drop shadow / alpha setting
- Changing native title bar status
- When the LookAndFeel is changed.
To name a few. The problem is that there is no way for the associated TopLevelWindow-derived Component to know when to reapply the setting for ComponentPeer::setCurrentRenderingEngine().
It seems to me that the choice of rendering engine should be made in the Component that has the heavyweight peer attached, rather than in the ComponentPeer, since it doesn’t survive across these calls.