http://bugs.winehq.org/show_bug.cgi?id=10142
--- Comment #22 from David Taylor davidt-wine@yadt.co.uk 2008-09-28 18:39:46 --- Well, bug 2368 seems to suggest a similar problem affects fvwm2. Don't have time to check it tonight, might try tomorrow.
Anyway, I attached trace logs from with and without my fix. With my fix has an added trace logging the values of the conditions which X11DRV_SetWindowPos uses to determine whether or not to unmap the window, plus I added (sw_flags & SWP_NOMOVE).
When SetWindowPos is called for a window which is positioned off-screen, event_type ends up as 0, the rectangle is not mapped, so the window is unmapped. It does not get re-mapped or put back on screen when I switch back. The patch prevents the window being unmapped as a result of the extra calls of SetWindowPos which don't actually move the window.