http://bugs.winehq.org/show_bug.cgi?id=10142
--- Comment #9 from Daniel van Vugt vanvugt@gmail.com 2008-03-19 05:59:35 --- I think I've found the problem, and would like to blame wine and compiz both at once.
When the window vanishes, I can find it if I noted it's window ID before losing it and then: xwininfo -id <number>. What I found was that it's invisible because the window becomes unmapped (state "IsUnMapped" which usually means minimized) AND it's position has changed to very far left of my left-most desktop (all corners of the window have negative X locations).
So the window is both minimized and on an impossible desktop. This means it will never appear in the window list of any desktop I can get to, and will not appear in the collection of all visible windows (ctrl-alt-up?).
The root cause of this problem clearly lies somewhere in the app itself (which is closed source) or wine causing the app window to move incorrectly. However I can easily imagine fixes being implemented in both wine and compiz for robustness. I think it's clear that some window managers such as metacity already have such sanity checks built in to stop this from happening.
The simple fix is probably: If all corners of the window have been moved off all desktops, then recover the window by placing it on the visible desktop and remapping the window (unminimize).
Admittedly, the window manager is probably the easiest place to implement this because wine can't know all the details of the window manager. However the root causing bug which results in the app window moving randomly and wildly is no doubt in wine's window message (WM_) handling.