fix hasDisplay logic

Now creates a dummy window to see if the main window can be created.