Backport popup windows size fixes from master