aboutsummaryrefslogtreecommitdiffstats
path: root/pugl
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-10-20 23:09:14 +0200
committerDavid Robillard <d@drobilla.net>2020-10-20 23:09:14 +0200
commit31245d358357dacce3b1ff70458c37a6c04008bd (patch)
tree28141a637ffa4aa77ec2856255808a6ddf65d064 /pugl
parenta8d2aa2761dcbaf491da09a375e246758b1137c4 (diff)
downloadpugl-31245d358357dacce3b1ff70458c37a6c04008bd.tar.gz
pugl-31245d358357dacce3b1ff70458c37a6c04008bd.tar.bz2
pugl-31245d358357dacce3b1ff70458c37a6c04008bd.zip
Fix puglSendEvent() error handling on X11
Diffstat (limited to 'pugl')
-rw-r--r--pugl/detail/x11.c2
-rw-r--r--pugl/pugl.h13
2 files changed, 13 insertions, 2 deletions
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);