v2: * Fixed deadlock by introducing a simple weak reference system for `wayland_surface` (see below for more info). * Be more explicit about the z-order placement of child and client (sub)surfaces to become more robust to the order of window creation/configuration. * Fix presentation of child windows that partially (e.g., decorations) or fully use GDI and whose parent has GL/VK client content (e.g., what is done by @rbernon's program linked from https://gitlab.winehq.org/wine/wine/-/merge_requests/5573#note_69513)
The deadlock was caused by trying to lock a parent surface using the parent HWND stored in the locked child surface, since that created lock sequences of the form: `[child_surface.mutex, win_data_mutex]` which is the reverse of the typical lock sequence we get in our driver functions (e.g., WindowPosChanged). Now each `wayland_surface` holds a weak reference to its parent surface, so we don't need to go through `win_data_mutex` to access the parent surface.
Note that the deadlock fix discussed in https://gitlab.winehq.org/wine/wine/-/merge_requests/6025#note_75558 is still required, but it's a different issue to what is fixed by this update.