Application loses focus on showing a non-focusable window
The problem affects X server implementation in recent Cygwin/X builds. It was originally discovered in IntelliJ-platform-based IDEs, but to demonstrate the problem, source code for a minimal X client application is provided (see attached popup.c) . This application is expected to toggle showing a popup window on each received key press event (show it on the first key press, hide on the second one, show again on the third one, etc.). With latest Cygwin/X build in multiwindow mode though, after the popup window is shown first time, application loses focus, and stops receiving keyboard input.
The problem is reproduced on Windows 10 Pro (21H2 build 19044.1706) for Cygwin/X xorg-server package version 21.1.1-1 and later ones, but not for version 1.20.12-1 and earlier ones.