I'm running X across a slow network connection. How can I tell when a window has become visible? I need to wait so that I can perform another operation on the visible window.
xterm -T foo &
# how to flush the display, or wait until the window is visible?
# polling the visibility would be acceptable as well
xmovewindow foo 10 20
update: Thanks to Jim Lewis, here's a quick shell function that does the trick.
function xwait() {
while ! xwininfo -name $1|grep 'Map State: IsViewable';do sleep 1;done
}
xterm -T foo &
xwait foo
xmovewindow foo 10 20