Popup: Do not reposition if the popup remains on-screen after a resize

Fixes gh-7862