Fixed window close/show issue.