mod/maxgui.mod/fltkmaxgui.mod/src/Fl.cxx
void Fl::flush() {
  if (damage()) {
    damage_ = 0;
    for (Fl_X* i = Fl_X::first; i; i = i->next) {
      if (i->wait_for_expose) {damage_ = 1; continue;}
      Fl_Window* wi = i->w;
      if (!wi->visible_r()) continue;
      if (wi->damage()) {i->flush(); wi->clear_damage();}
      // destroy damage regions for windows that don't use them:
      if (i->region) {XDestroyRegion(i->region); i->region = 0;}
    }
  }
#if defined(USE_X11)
  if (fl_display) XFlush(fl_display);
#elif defined(WIN32)
  GdiFlush();
#elif defined (__APPLE_QUARTZ__)
  if (fl_gc)
    CGContextFlush(fl_gc);
#else
# error unsupported platform
#endif
}
/**
  Causes all the windows that need it to be redrawn and graphics forced
  out through the pipes.
  
  This is what wait() does before looking for events.

  Note: in multi-threaded applications you should only call Fl::flush()
  from the main thread. If a child thread needs to trigger a redraw event,
  it should instead call Fl::awake() to get the main thread to process the
  event queue.
*/
Causes all the windows that need it to be redrawn and graphics forced
out through the pipes.

This is what wait() does before looking for events.

in multi-threaded applications you should only call Fl::flush()
from the main thread. If a child thread needs to trigger a redraw event,
it should instead call Fl::awake() to get the main thread to process the
event queue.
Causes all the windows that need it to be redrawn and graphics forced out through the pipes . This is what wait () does before looking for events . in multi - threaded applications you should only call Fl :: flush () from the main thread . If a child thread needs to trigger a redraw event it should instead call Fl :: awake () to get the main thread to process the event queue .
void Fl::flush() {
  if (damage()) {
    damage_ = 0;
    for (Fl_X* i = Fl_X::first; i; i = i->next) {
      if (i->wait_for_expose) {damage_ = 1; continue;}
      Fl_Window* wi = i->w;
      if (!wi->visible_r()) continue;
      if (wi->damage()) {i->flush(); wi->clear_damage();}
      if (i->region) {XDestroyRegion(i->region); i->region = 0;}
    }
  }
#if defined(USE_X11)
  if (fl_display) XFlush(fl_display);
#elif defined(WIN32)
  GdiFlush();
#elif defined (__APPLE_QUARTZ__)
  if (fl_gc)
    CGContextFlush(fl_gc);
#else
# error unsupported platform
#endif
}
void Fl :: flush ( ) { if ( damage ( ) ) { damage_ = 0 ; for ( Fl_X * i = Fl_X :: first ; i ; i = i -> next ) { if ( i -> wait_for_expose ) { damage_ = 1 ; continue ; } Fl_Window * wi = i -> w ; if ( ! wi -> visible_r ( ) ) continue ; if ( wi -> damage ( ) ) { i -> flush ( ) ; wi -> clear_damage ( ) ; } if ( i -> region ) { XDestroyRegion ( i -> region ) ; i -> region = 0 ; } } } #if defined ( USE_X11 ) if ( fl_display ) XFlush ( fl_display ) ; #elif defined ( WIN32 ) GdiFlush ( ) ; #elif defined ( __APPLE_QUARTZ__ ) if ( fl_gc ) CGContextFlush ( fl_gc ) ; #else # error  unsupported platform #endif }
Causes all the windows that need it to be redrawn and graphics forced
out through the pipes.
Causes all the windows that need it to be redrawn and graphics forced out through the pipes .
// destroy damage regions for windows that don't use them: