Backport popup fixes from 3.0 tree.
Backport popup fixes from 3.0 tree.

bk: 3d267eefOuUXEuQ79Xurw1pQ9EKjpw
bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper,bitkeeper-scm/bitkeeper