From 809ead2220f5a9ed66f88b1ae84a93e334e2717f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 12 Sep 2015 19:45:02 -0400 Subject: Add puglWaitForEvent for blocking main loops. --- pugl/pugl_x11.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pugl/pugl_x11.c') diff --git a/pugl/pugl_x11.c b/pugl/pugl_x11.c index 6375609..32501da 100644 --- a/pugl/pugl_x11.c +++ b/pugl/pugl_x11.c @@ -493,6 +493,14 @@ puglGrabFocus(PuglView* view) view->impl->display, view->impl->win, RevertToPointerRoot, CurrentTime); } +PuglStatus +puglWaitForEvent(PuglView* view) +{ + XEvent xevent; + XPeekEvent(view->impl->display, &xevent); + return PUGL_SUCCESS; +} + PuglStatus puglProcessEvents(PuglView* view) { @@ -544,6 +552,7 @@ puglProcessEvents(PuglView* view) if (view->ctx_type == PUGL_CAIRO) { cairo_xlib_surface_set_size( view->impl->surface, view->width, view->height); + view->redisplay = true; } #endif } -- cgit v1.2.1