if (DBG) printf("Ate %d events\n", count);
printf("Ate %d events\n", count);
void nsXtWidget_ExposureMask_EventHandler(Widget w, XtPointer p, XEvent * event, Boolean * b){  if (DBG) fprintf(stderr, "In nsXtWidget_ExposureMask_EventHandler Type %d (%d,%d)\n", event->type, Expose, GraphicsExpose);  nsWindow * widgetWindow = (nsWindow *) p ;  nsPaintEvent pevent;  nsRect       rect;  nsXtWidget_InitNSEvent(event, p, pevent, NS_PAINT);  pevent.rect = (nsRect *)&rect;  XEvent xev;  if (widgetWindow->GetResized())   return;  int count = 0;  while (XPeekEvent(XtDisplay(w), &xev))  {     if ((xev.type == Expose || xev.type == GraphicsExpose || xev.type == 14) &&          (xev.xexpose.window == XtWindow(w))) {       XNextEvent(XtDisplay(w), &xev);       count++;     } else {       if (DBG) printf("Ate %d events\n", count);       break;     }  }  widgetWindow->OnPaint(pevent);#if 0  nsPaintEvent pevent;  nsRect       rect;  nsXtWidget_InitNSEvent(event, p, pevent, NS_PAINT);   pevent.rect = (nsRect *)&rect;printf("Count %d\n", event->xexpose.count);  if (event->xexpose.count != 0)    return ;  /* Only post Expose/Repaint if we know others arn't following   * directly in the queue.   */  if (event->xexpose.count == 0) {    Boolean      debug = PR_TRUE;    int          count = 0;    CollapseInfo cinfo;    cinfo.win = XtWindow(w);    cinfo.r   = pevent.rect;    rect.x      = event->xexpose.x;    rect.y      = event->xexpose.y;    rect.width  = event->xexpose.width;    rect.height = event->xexpose.height;printf("Before %d %d %d %d\n", rect.x, rect.y, rect.width, rect.height);    /* Do a little more inspecting and collapse further if there     * are additional expose events pending on this window where     * the damage rects intersect with the current exposeRect.     */    while (1) {      XEvent xev;      if (XCheckIfEvent(XtDisplay(w), &xev, checkForExpose, (XtPointer)&cinfo)) {        printf("]]]]]]]]]]]]]]]]]]]]]]]]]]]]]\n");        count = xev.xexpose.count;        expandDamageRect(&rect, &xev, debug, "2");              } else /* XCheckIfEvent Failed. */       break;    }printf("After %d %d %d %d\n", rect.x, rect.y, rect.width, rect.height);  }  widgetWindow->OnPaint(pevent);  if (DBG) fprintf(stderr, "Out nsXtWidget_ExposureMask_EventHandler\n");#endif}