forked from joejulian/gio
e834a78ab2
On Xephyr, when fitst entering x11Window.loop(), syscall.Ppoll would block forever while XPending() would still return a non zero value. This commit refactors the loop so that XPending() gets called first, then fallback to waiting in ppoll if there are no pending draw events. This has the added benefit of reducing the number of calls to ppoll when receiving a lot of events. Signed-off-by: Denis Bernard <db047h@gmail.com>