More efficient pop-up close event handling