Fix dialogs always shown on top (fix #242).