TRACE(("BELL %d\n", percent));
Bell(int which GCC_UNUSED, int percent){    register TScreen *screen = &term->screen;    struct timeval curtime;    long now_msecs;    /* has enough time gone by that we are allowed to ring       the bell again? */    if(screen->bellSuppressTime) {	if(screen->bellInProgress) {	    do_xevents();	    if(screen->bellInProgress) { /* even after new events? */		return;	    }	}	X_GETTIMEOFDAY(&curtime);	now_msecs = 1000*curtime.tv_sec + curtime.tv_usec/1000;	if(lastBellTime != 0  &&  now_msecs - lastBellTime >= 0  &&	   now_msecs - lastBellTime < screen->bellSuppressTime) {	    return;	}	lastBellTime = now_msecs;    }    if (screen->visualbell)	VisualBell();    else#ifdef XKB	XkbStdBell(screen->display,TWindow(screen),percent,which);#else	XBell(screen->display, percent);#endif    if(screen->bellSuppressTime) {	/* now we change a property and wait for the notify event to come	   back.  If the server is suspending operations while the bell	   is being emitted (problematic for audio bell), this lets us	   know when the previous bell has finished */	Widget w = CURRENT_EMU(screen);	XChangeProperty(XtDisplay(w), XtWindow(w),			XA_NOTICE, XA_NOTICE, 8, PropModeAppend, NULL, 0);	screen->bellInProgress = TRUE;    }}