From f269a6af97b7eac847bff6140d2ceccdc3f6ed0f Mon Sep 17 00:00:00 2001 From: Alex Sanchez-Stern Date: Thu, 3 Oct 2024 16:01:51 -0700 Subject: [PATCH] Add ability to get the clipboard target window This allows users to claim the selection independently in a way that's compatible with the handlers from GLFW. --- include/GLFW/glfw3native.h | 1 + src/x11_window.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/GLFW/glfw3native.h b/include/GLFW/glfw3native.h index d4daa1f5..4cbe5c45 100644 --- a/include/GLFW/glfw3native.h +++ b/include/GLFW/glfw3native.h @@ -448,6 +448,7 @@ extern void (*handleSelectionRequest)(XEvent*); void (*getSelectionRequestHandler(void))(XEvent*); void setSelectionRequestHandler(void (*handler)(XEvent*)); Display* getGLFWDisplay(void); +Window getGLFWHelperWindow(void); #endif diff --git a/src/x11_window.c b/src/x11_window.c index 787004d1..69569514 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -3367,5 +3367,8 @@ Display* getGLFWDisplay(void) { return _glfw.x11.display; } -#endif // _GLFW_X11 +Window getGLFWHelperWindow(void) { + return _glfw.x11.helperWindowHandle; +} +#endif // _GLFW_X11