while((mask = XtAppPending(ac)) > 0) XtAppProcessEvent(ac, mask);
for (i=0; i < XTBIN_MAX_EVENTS && XPending(display); i++) { XtAppProcessEvent(ac, XtIMXEvent); }  printf("dispatch %d\n", i);
xt_event_dispatch (gpointer  source_data,                    GTimeVal *current_time,                    gpointer  user_data){  XEvent event;  Display * display;  XtAppContext ac;  XtInputMask mask;  display = (Display *)user_data;  ac = XtDisplayToApplicationContext(display);  GDK_THREADS_ENTER ();  while((mask = XtAppPending(ac)) > 0)    XtAppProcessEvent(ac, mask);  GDK_THREADS_LEAVE ();  return TRUE;  }