https://bugs.winehq.org/show_bug.cgi?id=15346
Gabriel Ivăncescu gabrielopcode@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #63094|0 |1 is obsolete| |
--- Comment #37 from Gabriel Ivăncescu gabrielopcode@gmail.com --- Created attachment 68411 --> https://bugs.winehq.org/attachment.cgi?id=68411 Let the Window Manager handle the off-screen window if it's managed.
Here's an updated patch that simplifies it, now that I understand a lot more about the winex11 driver code.
As a simplified overview, in general the driver callbacks have two cases: when they are handled during an X11 event, and when they're handled by a Win32 call without an event.
The distinction is important: when we are processing an X11 event, we want to sync the windows side to match what the X11 state reports (for example, if the user resizes the X11 window, we make it match on the windows side).
When we are not processing an event, we do it the other way around: we sync the X11 server state with the windows side, to match what the windows side reports. For example, if you call SetWindowPos without any event, the X11 window must obviously respond accordingly and actually move on the screen.
In this particular case, we move the window by dragging it, i.e. X11 event. *However*, the application (Winamp) calls SetWindowPos on itself outside of this, so in fact, we are *not* processing an event during that callback.
The code in question clearly has !event_type, which only runs when there's no event anyway. What the current code attempts to do is check if the window is basically "offscreen" (including multiple monitors). If so, it unmaps it (i.e. hides it).
But that's the problem, and that's why it shows up only when the windows are managed. Window Managers have their own way to deal with offscreen windows, and we should simply respect that by sending the window position as offscreen so they handle it, instead of trying to hide it ourselves. One popular example is virtual desktops or workspaces built into the WM.
So this patch simply removes the window unmapping if the window is managed, and the issue is solved.
Please note that the former patch above does exactly the same thing in this context. That is because querying the WM for the window position when we are *not* processing an event is going to always report it as on-screen (because we haven't synced it yet to the windows side that moves it off-screen). So it's kind of useless to query it.
I tested the patch and it works with both managed and non-managed modes (in winecfg).