While we do not have subwindows in Wayland, we do create an artificial root window. When the display is closed, the root window gets destroyed, causing recursing to be true for the toplevel windows.