updated makes a pending paint event. the first process_events does the actual paint. Then we wait for something magical to happen. Then process more events. This does it on my system, but it's not an exact science :/

No, GLUT resizing does not work with this. You want me to try with your earlier version?