'Globally Active' clients don't receive focus events on switching from/to native windows in multiwindow mode
When xorg-server works in 'multiwindow' mode on Windows, some clients do not receive
FocusIn events when user switches between top-level windows of those clients and native (non-X11) windows. This happens for 'Globally Active' (as per ICCCM spec) clients, which set input focus to a child of top-level window. Example applications are emacs and Java AWT applications (e.g. IntelliJ IDEA and other IntelliJ-platform based IDEs including Android Studio). Due to the bug, they might look focused (with caret blinking, etc), when text input is actually directed to another application, and not perform expected actions on application activation/deactivation (like document saving/loading in IntelliJ IDEs).
The problem can also be reproduced for the simple application, with source code attached to the ticket (focustest.c). The application's window is colored in black when it perceives itself as focused, and in white, when not focused. If one switches focus from this application to native app's (non-X11) window, e.g. using mouse click, the application's window stays black.
The problem was reproduced on Cygwin/X (xorg-server version 1.20.12-1) and VcXsrv 188.8.131.52 on Windows 10 version 21H1 (build 19043.1165).
It was previously reported for Cygwin/X and VcXsrv: