Adapt to the new way of creating main windows.