diff --git a/docs/changelog.rst b/docs/changelog.rst index 9550f1ebb..c9f8d72f7 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -215,6 +215,9 @@ Detailed list of changes - Graphics: Fix images briefly disappearing for one frame the first time an image is replaced during a synchronized update (:iss:`10538`) +- X11: Fix copy and paste targeting the wrong OS window when the keyboard focus + is set to PointerRoot or None + 0.49.1 [2026-09-24] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/glfw/x11_window.c b/glfw/x11_window.c index 01ac6c6b2..4e3ed35da 100644 --- a/glfw/x11_window.c +++ b/glfw/x11_window.c @@ -2135,6 +2135,11 @@ processEvent(XEvent *event) { // key chords and window dragging return; } + if (event->xfocus.detail == NotifyPointer) { + // Ignore focus events for the window under the pointer when the + // focus is set to PointerRoot or None + return; + } if (window->cursorMode == GLFW_CURSOR_DISABLED) disableCursor(window); @@ -2148,6 +2153,11 @@ processEvent(XEvent *event) { // key chords and window dragging return; } + if (event->xfocus.detail == NotifyPointer) { + // Ignore focus events for the window under the pointer when the + // focus is set to PointerRoot or None + return; + } if (window->cursorMode == GLFW_CURSOR_DISABLED) enableCursor(window);