Linux (Xlib) Application hangs on GetGeometry()

Hello,

I was just wondering why XGetGeometry() would cause a hang in an application.

In the xlib book it says any of there "Get" functions don't necessarily return immediately.

Is there a way to make a it return immediately or other functions that will give me the same results.

I tried using XFlush() and Xsync() before & after the XGetGeometry() function call. Also I tried using xlib's XGetWindowAttributes() instead of XGetGeometry().

Because they're stateful: The server doesn't just acknowledge receiving it, it must perform the command and retrieve the answer before the command returns.