I just need to close the window after the case is resolved.
I tried doing it in the end of the OnSave javascript event, but I am not sure that's the right way because I'm afraid that there are some other events that get fired by CRM so the Case will be saved the right way.