Don't create the canvas until the window is shown.

@aashish24