Description
This is an issue on both X11 and Windows: When the relative mode is enabled in one window, pressing mouse buttons when the hidden cursor is hovered over a child window, can steal the focus and disable relative mode.
On X11 the cursor position is constrained within the window where relative mode is enabled, but the cursor can still hover over any child windows that are overlapping with the parent window, and when clicking any mouse buttons while hovering over the child window, the relative mode is disabled and focus is moved to the child window.
On Windows this is harder to reproduce but still possible just like in X11, but while the cursor position is locked to the center of the window when relative mode is enabled, the same situation can happen if any child window is overlapping the parent window around the center of the window.