我正在通过慢速网络连接运行 X。如何判断窗口何时可见?我需要等待,以便我可以在可见窗口上执行另一个操作。
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
更新:感谢 Jim Lewis,这里有一个快速的 shell 函数可以解决问题。
function xwait() {
while ! xwininfo -name $1|grep 'Map State: IsViewable';do sleep 1;done
}
xterm -T foo &
xwait foo
xmovewindow foo 10 20