if (! screen->rfbClientHead) {
if (! screen->clientHead) {
static void watch_loop(void) {	int cnt = 0;	double dt = 0.0;	if (use_threads) {		rfbRunEventLoop(screen, -1, TRUE);	}	while (1) {		got_user_input = 0;		got_pointer_input = 0;		got_keyboard_input = 0;		if (! use_threads) {			rfbPE(screen, -1);			if (! cursor_shape_updates) {				unset_cursor_shape_updates(screen);			}			if (check_user_input(dt, &cnt)) {				/* true means loop back for more input */				continue;			}		}		if (shut_down) {			clean_up_exit(0);		}		check_xevents();		check_connect_inputs();				if (! screen->rfbClientHead) {	/* waiting for a client */			usleep(200 * 1000);			continue;		}		if (nofb) {			/* no framebuffer polling needed */			if (cursor_pos_updates) {				/* -nofb -cursorpos usage is rare */				check_x11_pointer();			}			continue;		}		if (watch_bell) {			/*			 * check for any bell events.			 * n.b. assumes -nofb folks do not want bell...			 */			check_bell_event();		}		if (! show_dragging && button_mask) {			/* if any button is pressed do not update screen */			/* XXX consider: use_threads || got_pointer_input */			X_LOCK;			XFlush(dpy);			X_UNLOCK;		} else {			/* for timing the scan to try to detect thrashing */			double tm = 0.0;			dtime(&tm);			rfbUndrawCursor(screen);			scan_for_updates();			check_x11_pointer();			dt = dtime(&tm);		}		/* sleep a bit to lessen load */		usleep(waitms * 1000);		cnt++;	}}