http://bugs.winehq.org/show_bug.cgi?id=9320
--- Comment #16 from Vincent Povirk madewokherd@gmail.com 2009-11-08 17:51:24 --- Removing that check has at least one interesting side-effect: We can now get FocusIn events (which we basically ignore) and FocusOut events on windows in a virtual desktop.
When we get a FocusOut event, we change the foreground window to the desktop window. That means that, when we activate the desktop window by clicking its titlebar, we have no foreground window and end up focusing the desktop instead of the app, which is what I clearly want.
I think we should remember the window that had the focus when the desktop lost focus, and return to that window when it gets the focus back. (We could also try to not change the foreground window when the desktop loses focus, but removing that line just brought things back to the status quo for some reason.. maybe we need that to re-focus the window properly.)