On Wed Nov 29 15:20:34 2023 +0000, Rémi Bernon wrote:
I don't really see why it would need an additional `XSync` if the current synchronization is correct. The only synchronization points are the same as before or after this MR:
- when client_window is created using the gdi_display, we need to make
sure gdi_display knows about its whole_window parent beforehand. After the creation we also need a XFlush so to make sure the creation requests will be seen by other displays. 2) before XSelectInput is called with thread display, we need to make sure thread display know about the client window. 3) when whole_window is destroyed, through the thread display, we need to make sure any client window has been fully reparented to a different window. The reparenting request is made on the gdi_display, so we could do `XFlush( gdi_display ); XSync( thread->display )` but as this is only causing errors after the whole window request is sent and processed, a `XSync( gdi_display )` should be enough. Re-parenting alone should not need any synchronization as whole_window is still valid at that point, and you can reparent windows as many times as you like, as long as both windows stay valid.
Are you sure that deleting parent whole_window is the only case for which synchronization is needed? E. g., X11DRV_Expose() handles events for client window, don't we want to make sure the current X window tree is synced as soon as client window is detached? Also, if we have, e. g., some resize or iconify of the whole window, while X still thinks that client window is its child, what happen to it?