Experimenting a bit, I found that if we ensure that the client surface does not have an attached buffer before creating a new wl_subsurface for it, then the issues go away, but this shouldn't be needed (Weston works fine for example). FWIW, last time I tried mutter it also didn't behave well with more complex subsurfaces scenarios, so I haven't been using it much for testing these MRs.
Maybe it's a matter of avoiding unnecesary client window attach/detach operations, I didn't try to be very careful about that. Or can we also maybe detach buffers from the surface ourselves?
I am thinking that a possible approach here is to avoid all commits on `client->wl_surface` (i.e., in reconfigure_client) and let all changes be applied when EGL/VK performs the next commit itself.
That sounds completely reasonable to me.