https://bugs.winehq.org/show_bug.cgi?id=38708
--- Comment #6 from George Gonzalez ggonzalez@codeweavers.com --- There is a very nice and small test program attached to bug #2155 that shows this problem using a small test program.
There also is an alleged fix attached, however the whole X11 set_focus code has draastically changed since that patch was young, like code has moved by 1,200 lines. So the patch is not easily applied. Also the patch uses somewhat-dodgy X11 calls that are not used anywhere else in Wine, plus a timeout loop, which just on general principles may not be the best way to fix this.