The decision to instantiate (or not) the `data->wayland_surface` member is made in the `WindowPosChanged` driver callback which is called after `WindowPosChanging`. This means we can't rely on that member at this point to make a choice about the need for window surface.
I think what is proposed in the MR may tend to work in many cases because the WindowPosChang* sequence is typically called multiple times, but the correct solution seems to me to revert to the previous check-if-window-is-child behavior.