if (XtAppPending(ac))
int eventsToProcess = 20; while (eventsToProcess-- && XtAppPending(ac))
xt_event_polling_timer_callback(gpointer user_data){  Display * display;  XtAppContext ac;  display = (Display *)user_data;  ac = XtDisplayToApplicationContext(display);  /* don't starve the primary event queue - just process one event */  if (XtAppPending(ac))    XtAppProcessEvent(ac, XtIMAll);  return TRUE;}