When a window has moved over a component, how to listen for this

In my OpenGL hacks I've found I need to repaint when a window occludes the opengl rendering area, but since there are no messages going to the component, how does it know to repaint? 

Is there something like virtual onOverlappingWindowMovement() anywhere?

I'd be very sceptical about a hack that made that necessary!

Nope, there's certainly no way to detect window overlapping, but that's the wrong way to look at it anyway - if a window region needs repainting, then win32 sends you a repaint message. Obviously the juce classes normally handle that for you, but if you've hacked things so that it no longer works, then good luck!

Ah ok. I'll have to debug where that repaint message is going. 

You've probably got the Juce OpenGL 'on-demand' rendering turned on (gag).

Make sure that your repaint override triggers a fresh OpenGL paint. I wouldn't be surprised if the on-demand thing had some edge cases. It feels hacky to me - every other OpenGL system renders every frame, even when nothing has changed.