https://bugs.winehq.org/show_bug.cgi?id=48121
--- Comment #8 from w@zeroitlab.com --- On a second look fixing the issue might be a bit more complicated. Looking a bit further into the behavior of clicking on the caption on wine, wine with virtual desktop, and windows, the behavior is the following:
- Wine on X11: window receives a WM_MOUSEACTIVATE on a HTMENU (regardless if it actually has any menus or not), then depending on the reply it activates the window - Windows and Wine with virtual desktop: window receives a WM_MOUSEACTIVATE on a HTCAPTION, ignores the window's wish to not be activated and activates it anyways, then later the window receives a WM_NCLBUTTONDOWN. This makes Unity work.
There are two okay-ish ways to fix this: - Make the X11 implementation either not test anything, or test HTCAPTION and ignore result and send a WM_NCLBUTTONDOWN after. - Send a WM_NCLBUTTONDOWN after testing for HTMENU. This is somewhat a band-aid fix since the program will still receive a WM_MOUSEACTIVATE with HTMENU even if it has no menus at all, however we can keep the current activation behavior.