rfbLogEnable(1);
int handle_subwin_resize(char *msg) {	int new_x, new_y;	int i, check = 10, ms = 250;	/* 2.5 secs total... */	if (! subwin) {		return 0;	/* hmmm... */	}	if (! valid_window(subwin, NULL, 0)) {		rfbLog("subwin 0x%lx went away!\n", subwin);		X_UNLOCK;		clean_up_exit(1);	}	if (! get_window_size(subwin, &new_x, &new_y)) {		rfbLog("could not get size of subwin 0x%lx\n", subwin);		X_UNLOCK;		clean_up_exit(1);	}	if (wdpy_x == new_x && wdpy_y == new_y) {		/* no change */		return 0;	}	/* window may still be changing (e.g. drag resize) */	for (i=0; i < check; i++) {		int newer_x, newer_y;		usleep(ms * 1000);		if (! get_window_size(subwin, &newer_x, &newer_y)) {			rfbLog("could not get size of subwin 0x%lx\n", subwin);			clean_up_exit(1);		}		if (new_x == newer_x && new_y == newer_y) {			/* go for it... */			break;		} else {			rfbLog("subwin 0x%lx still changing size...\n", subwin);			new_x = newer_x;			new_y = newer_y;		}	}	rfbLog("subwin 0x%lx new size: x: %d -> %d, y: %d -> %d\n",	    subwin, wdpy_x, new_x, wdpy_y, new_y);	rfbLog("calling handle_xrandr_change() for resizing\n");	X_UNLOCK;	handle_xrandr_change(new_x, new_y);	return 1;}