Rethink the startup sequence
Currently, wayland clients are allowed to create xdg-toplevels and xdg-popups prior to the moment when the workspace is created and initialized. This is a bit problematic because classes such as X11Client and XdgToplevelClient need an initialized workspace to function as desired.
There are several ways how to handle such clients:
(a) Do nothing. If an xdg-toplevel or an xdg-popup is created and the workspace hasn't been initialized yet, do nothing. This is what kwin currently does.
(b) Queue xdg-toplevels and xdg-popups. Once the workspace is initialized, go through the queue and create XdgToplevelClients and XdgPopupClients. The main problem with this approach is that we may miss requests such as set_maximized or set_fullscreen, which are sent prior to the initial commit.
(c) Announce the support for the xdg-shell protocol when the workspace is initialized. We probably can't do it because toolkits such as Qt will bailout if the xdg_wm_base global is not announced during the initial roundtrip.
(d) Have some way for the compositor to announce that it has been initialized and the rest of the desktop environment can proceed with the startup sequence.