mirror of
https://github.com/glfw/glfw.git
synced 2025-10-05 06:06:36 +00:00
Handle X11 Selection* events despite NULL window
`processEvent` in `x11_window.c` currently discards events that can not be mapped to a current GLFW window. However, this breaks clipboard functionality by failing to respond to SelectionRequest and SelectionClear events. This commit moves processing of these important clipboard events to before the NULL window test so that they are always considered. Fixes #961 (tentatively; there is probably an underlying structural change to be made that fixes this properly).
This commit is contained in:
parent
798d7c6d68
commit
8d7de79107
@ -957,6 +957,17 @@ static void processEvent(XEvent *event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event->type == SelectionClear)
|
||||||
|
{
|
||||||
|
handleSelectionClear(event);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (event->type == SelectionRequest)
|
||||||
|
{
|
||||||
|
handleSelectionRequest(event);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
window = findWindowByHandle(event->xany.window);
|
window = findWindowByHandle(event->xany.window);
|
||||||
if (window == NULL)
|
if (window == NULL)
|
||||||
{
|
{
|
||||||
@ -1476,18 +1487,6 @@ static void processEvent(XEvent *event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
case SelectionClear:
|
|
||||||
{
|
|
||||||
handleSelectionClear(event);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case SelectionRequest:
|
|
||||||
{
|
|
||||||
handleSelectionRequest(event);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case DestroyNotify:
|
case DestroyNotify:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user