Make sure the window is visible and not minimized.