This is yet another attempt at fixing the way wine handles X11 wm desktop switches. Currently, wine minimizes the windows on switch away, then restores them. That's the wrong thing to do. For example, that unpauses apps that pause on focus loss.
First part of the problem is quite simple.
Adding a check for NET_WM_STATE_HIDDEN and returning early if it's not set while the wmstate is iconic deals with that.
The other part is a pain though. As the windows on other desktops are invisible, they shouldn't be considered valid input sinks by wine.
The problem is two-fold: - can_activate_window is a static function both in winex11.drv and user32.dll; what's more one in user32.dll doesn't handle WS_EX_NOACTIVATE the way one in winex11.drv does - x11drv_win_data is (for obvious reasons) an internal detail of winex11.drv
As such, it's hard to come up with something that would reach user32.dll and didn't have some nasty side effects.
I'm trying to use WS_EX_NOACTIVATE in this version, but (as already mentioned) that isn't working with user32.dll *and* has some undesirable side-effects.
Trying to use either WS_VISIBLE or WS_DISABLED doesn't work at all or at least I'm not able to use that properly.
So, better ideas welcomed.