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.