add a shutdown handler to cleanup event listeners
ensure the popup panel doesn't interfere with focus