Generalize focus popup handling