if (! servertime) {
if (! ticker_atom) {
void sync_tod_with_servertime() {	static Atom servertime = None;	XEvent xev;	char diff[64];	static int seq = 0;	int i, db = 0;	if (! servertime) {		servertime = XInternAtom(dpy, "X11VNC_SERVERTIME_DIFF", False);	}	if (! servertime) {		return;	}	XSync(dpy, False);	while (XCheckTypedEvent(dpy, PropertyNotify, &xev)) {		;	}	snprintf(diff, 64, "%.6f/%08d", servertime_diff, seq++); 	XChangeProperty(dpy, rootwin, servertime, XA_STRING, 8,	    PropModeReplace, (unsigned char *) diff, strlen(diff));	XSync(dpy, False);	for (i=0; i < 10; i++) {		int k, got = 0;				for (k=0; k < 5; k++) {			while (XCheckTypedEvent(dpy, PropertyNotify, &xev)) {				if (xev.xproperty.atom == servertime) {					double stime;										stime = (double) xev.xproperty.time;					stime = stime/1000.0;					servertime_diff = dnow() - stime;					if (db) rfbLog("set servertime_diff: "					    "%.6f\n", servertime_diff);					got = 1;				}			}		}		if (got) {			break;		}		usleep(1000);	}}