I did read your issue correctly. You are not supposed to close the window containing your plug-in view, it’s the business of the host. If you open a separate window then it’s up to you what you do with it, but you cannot close the window the host opens for you. It’s actually a bad user experience if you don’t provide a view for the window the host provides and open another window with decorations.