mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
X11: Make selection event checks include window
This commit is contained in:
parent
ccfd6dde45
commit
afb6e485b7
@ -138,6 +138,9 @@ static int getWindowState(_GLFWwindow* window)
|
|||||||
//
|
//
|
||||||
static Bool isSelectionEvent(Display* display, XEvent* event, XPointer pointer)
|
static Bool isSelectionEvent(Display* display, XEvent* event, XPointer pointer)
|
||||||
{
|
{
|
||||||
|
if (event->xany.window != _glfw.x11.helperWindowHandle)
|
||||||
|
return False;
|
||||||
|
|
||||||
return event->type == SelectionRequest ||
|
return event->type == SelectionRequest ||
|
||||||
event->type == SelectionNotify ||
|
event->type == SelectionNotify ||
|
||||||
event->type == SelectionClear;
|
event->type == SelectionClear;
|
||||||
@ -2272,8 +2275,13 @@ const char* _glfwPlatformGetClipboardString(_GLFWwindow* window)
|
|||||||
_glfw.x11.helperWindowHandle,
|
_glfw.x11.helperWindowHandle,
|
||||||
CurrentTime);
|
CurrentTime);
|
||||||
|
|
||||||
while (!XCheckTypedEvent(_glfw.x11.display, SelectionNotify, &event))
|
while (!XCheckTypedWindowEvent(_glfw.x11.display,
|
||||||
|
_glfw.x11.helperWindowHandle,
|
||||||
|
SelectionNotify,
|
||||||
|
&event))
|
||||||
|
{
|
||||||
waitForEvent(NULL);
|
waitForEvent(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (event.xselection.property == None)
|
if (event.xselection.property == None)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user