Once we reached that place where sync_window_position() is called (or not called if window is about to be minimized or maximized) the old in-flight X_ConfigureNotify do not make sense anymore. sync_window_position() does that unconditionally but if we don't call it for minimize / maximize we should probably discard them regardless.
An example of the failing scenario which this patch is fixing is the following: 1. App calls SetWindowPos() with some size, X_ConfigureNotify is in flight; 2. App calls ShowWindow(SW_MAXIMIZE), old X_ConfigureNotify is still in flight; sync_window_position() is not called and configure_serial is not updated; 3. Now X_ConfigureNotify from p.1 arrives and it gets processed like WM is changing window size back, that confuses the app and since the reaction on the new app's SetWindowPos / maximizing is also delayed and then X events triggered by p. 2. also arribe later. That may cause endless loop with non-functional window.
-- v2: winex11.drv: Increment configure_serial in X11DRV_WindowPosChanged() even if not syncing window position.
From: Paul Gofman pgofman@codeweavers.com
--- dlls/winex11.drv/window.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 3ebbee0856e..f3c11cff008 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2645,9 +2645,13 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, }
/* don't change position if we are about to minimize or maximize a managed window */ - if (!event_type && - !(data->managed && (swp_flags & SWP_STATECHANGED) && (new_style & (WS_MINIMIZE|WS_MAXIMIZE)))) - sync_window_position( data, swp_flags, &old_window_rect, &old_whole_rect, &old_client_rect ); + if (!event_type) + { + if (!(data->managed && (swp_flags & SWP_STATECHANGED) && (new_style & (WS_MINIMIZE|WS_MAXIMIZE)))) + sync_window_position( data, swp_flags, &old_window_rect, &old_whole_rect, &old_client_rect ); + else + data->configure_serial = NextRequest( data->display ); + }
if ((new_style & WS_VISIBLE) && ((new_style & WS_MINIMIZE) || is_window_rect_mapped( rectWindow )))
After some discussion with Rémi it looks more complicated than this: at least configure_serial should be incremented when the request which will queue the event is issued. I am closing this MR for now.
This merge request was closed by Paul Gofman.