https://bugs.winehq.org/show_bug.cgi?id=38201
--- Comment #6 from Ruslan Kabatsayev b7.10110111@gmail.com --- In any case, it seems that when a window gets real keyboard focus, i.e. when keyboard events will go into this window, it is not always represented as a foreground window in wine server.
The above doesn't even take into account that sometimes the window should become the foreground window even when it's invisible, as discussed in comment 2.