https://bugs.winehq.org/show_bug.cgi?id=38201
--- Comment #1 from Ruslan Kabatsayev b7.10110111@gmail.com --- Created attachment 50982 --> https://bugs.winehq.org/attachment.cgi?id=50982 Test with notepad-like window reproducing the problem
This is also visible in Wine's notepad. Because with normal windows even with children this doesn't immediately reproduce, I've studied what leads to this in notepad, and the trigger appears to be the call to SetFocus() before ShowWindow().
I attach a test program where you can see that commenting out the SetFocus() call or moving it below ShowWindow() will hide the bug, while running the program as is will reproduce the bug.
I've also checked this in Windows, and there no such behavior is present: newly-created toplevel window is always active at start.