Implemented right-click-to-close.