Handle popup windows (sort of).

Transient windows should be handled as well, but it doesn't really seem
to work (will get tracked down).