From 31245d358357dacce3b1ff70458c37a6c04008bd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 20 Oct 2020 23:09:14 +0200 Subject: Fix puglSendEvent() error handling on X11 --- pugl/detail/x11.c | 2 ++ pugl/pugl.h | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'pugl') diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c index 6958785..fd76606 100644 --- a/pugl/detail/x11.c +++ b/pugl/detail/x11.c @@ -859,6 +859,8 @@ puglSendEvent(PuglView* view, const PuglEvent* event) if (xev.type) { if (XSendEvent(view->impl->display, view->impl->win, False, 0, &xev)) { return PUGL_SUCCESS; + } else { + return PUGL_UNKNOWN_ERROR; } } diff --git a/pugl/pugl.h b/pugl/pugl.h index a665721..9c7ad26 100644 --- a/pugl/pugl.h +++ b/pugl/pugl.h @@ -1275,8 +1275,17 @@ puglStopTimer(PuglView* view, uintptr_t id); If supported, the event will be delivered to the view via the event loop like other events. Note that this function only works for certain event - types, and will return PUGL_UNSUPPORTED_TYPE for events that are not - supported. + types. + + Currently, only #PUGL_CLIENT events are supported on all platforms. + + X11: A #PUGL_EXPOSE event can be sent, which is similar to calling + puglPostRedisplayRect(), but will always send a message to the X server, + even when called in an event handler. + + @return + - #PUGL_UNSUPPORTED_TYPE if sending events of this type is not supported. + - #PUGL_UNKNOWN_ERROR if sending the event failed. */ PUGL_API PuglStatus puglSendEvent(PuglView* view, const PuglEvent* event); -- cgit v1.2.1