Perhaps "XOpenDisplay" connects to X server and waits for reply. But X server is blocked by "XOpenDisplay", so it can't do anything, and hang up. I integrated window manager to X server for rootless mode at the trial. At that time I had same problem. Creating X client thread solved it. Kensuke Matsuzaki