diff options
Diffstat (limited to 'include/yasl/native/x11.h')
| -rw-r--r-- | include/yasl/native/x11.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/yasl/native/x11.h b/include/yasl/native/x11.h index f8c37ae..6cc85fb 100644 --- a/include/yasl/native/x11.h +++ b/include/yasl/native/x11.h @@ -1,3 +1,4 @@ +/** @file Borrowed x11 handles for an initialized, connected surface. */ #ifndef YASL_NATIVE_X11_H #define YASL_NATIVE_X11_H #include "yasl/yasl.h" @@ -5,9 +6,15 @@ typedef struct _XDisplay Display; #ifdef __cplusplus extern "C" { #endif -/** Borrowed handles; surface/window lifetime and native connection stay in YASL. */ -YASL_API Display *yasl_x11_display(const yasl_surface *surface); -YASL_API uintptr_t yasl_x11_window(const yasl_surface *surface); +struct yasl_x11_handles { + Display *display; + uintptr_t window; +}; +/** Owner thread only. Returns -ENOTSUP for another backend and -ENOTCONN + * while disconnected. Clears out on failure. Handles expire on display loss + * or surface destruction; query again after DISPLAY_RESTORED. Never destroy + * borrowed objects or dispatch/close the connection independently. */ +YASL_API int yasl_x11_get_native(const yasl_surface *surface, struct yasl_x11_handles *out); #ifdef __cplusplus } #endif |
