Remove x11 thread, use select instead.