Rémi Bernon (@rbernon) commented about dlls/winewayland.drv/wayland_surface.c:
+ TRACE("surface=%p\n", surface); + + surface->xdg_surface = + xdg_wm_base_get_xdg_surface(process_wayland.xdg_wm_base, surface->wl_surface); + if (!surface->xdg_surface) goto err; + xdg_surface_add_listener(surface->xdg_surface, &xdg_surface_listener, surface); + + surface->xdg_toplevel = xdg_surface_get_toplevel(surface->xdg_surface); + if (!surface->xdg_toplevel) goto err; + + wl_surface_commit(surface->wl_surface); + wl_display_flush(process_wayland.wl_display); + + /* Wait for the initial configure event */ + while (!surface->pending_serial) + pthread_cond_wait(&surface->configured_cond, &surface->mutex); I don't know how critical this is, but FWIW waiting on condition variables is currently unstable in Wine, and you might end up with crashes that are difficult to debug. If possible, I think you should avoid it.
Also, as a general rule from winex11, I believe we try as much as possible to avoid blocking the threads. So it would be great if this could be asynchronous and decoupled from the configure event handler. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2944#note_35022