https://bugs.winehq.org/show_bug.cgi?id=48121
--- Comment #11 from w@zeroitlab.com ---
I don't remember exactly the kind of scenario we need it for, but removing it will break some cases.
I'm not exactly sure if breaking those cases isn't the right thing to do, because they won't work on real Windows in the first place (since programs that do require WM_MOUSEACTIVATE won't get that on actual Windows with alt-tab either). This line of code was added 18 years ago: https://github.com/wine-mirror/wine/commit/1a80921903a1d9a21aecca3aea6673e83... I went ahead and checked the messages on Windows 2000 to make sure, and it does not send anything other than what I listed earlier either, so this is not a "recent" change brought with DWM either.
UseTakeFocus makes Unity not lose focus in the first place, so is not a perfect solution, but does make most games playable.