Add support for closing windows.