From afb6e485b7b5e42a8e73b93e84d55c574d94f13b Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 6 Sep 2016 15:15:23 +0200 Subject: [PATCH] X11: Make selection event checks include window --- src/x11_window.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/x11_window.c b/src/x11_window.c index 2c4ade13..a5ec85fa 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -138,6 +138,9 @@ static int getWindowState(_GLFWwindow* window) // static Bool isSelectionEvent(Display* display, XEvent* event, XPointer pointer) { + if (event->xany.window != _glfw.x11.helperWindowHandle) + return False; + return event->type == SelectionRequest || event->type == SelectionNotify || event->type == SelectionClear; @@ -2272,8 +2275,13 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) _glfw.x11.helperWindowHandle, CurrentTime); - while (!XCheckTypedEvent(_glfw.x11.display, SelectionNotify, &event)) + while (!XCheckTypedWindowEvent(_glfw.x11.display, + _glfw.x11.helperWindowHandle, + SelectionNotify, + &event)) + { waitForEvent(NULL); + } if (event.xselection.property == None) continue;