aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail
diff options
context:
space:
mode:
authorosch <oliver at luced de>2019-09-11 20:20:59 +0200
committerDavid Robillard <d@drobilla.net>2019-11-17 13:32:59 +0100
commit077b31875b5fdd0d6f299c8834b8a626e263c099 (patch)
tree3713db3c62f2c6d2fb626c8cb342a88c4c5abf78 /pugl/detail
parent2f422e174ea79c9d37cdee83afa1cf3eebbaee98 (diff)
downloadpugl-077b31875b5fdd0d6f299c8834b8a626e263c099.tar.gz
pugl-077b31875b5fdd0d6f299c8834b8a626e263c099.tar.bz2
pugl-077b31875b5fdd0d6f299c8834b8a626e263c099.zip
X11: Don't select on server socket if events are already queued
Diffstat (limited to 'pugl/detail')
-rw-r--r--pugl/detail/x11.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c
index cc6eb5d..4f4d7e8 100644
--- a/pugl/detail/x11.c
+++ b/pugl/detail/x11.c
@@ -118,7 +118,9 @@ puglInitViewInternals(void)
PuglStatus
puglPollEvents(PuglWorld* world, const double timeout)
{
- XFlush(world->impl->display);
+ if (XPending(world->impl->display) > 0) {
+ return PUGL_SUCCESS;
+ }
const int fd = ConnectionNumber(world->impl->display);
const int nfds = fd + 1;