Don't check for workspace->initializing()
the existence of Window is bound to the one of workspace so it will always be there. We also need to check the window sizes before workspace is done initializing, otherwise when KWin restarts and there are maximized windows, they won't be resized to take panels into account and will always span the full screen.