layout: Fix-up the positions when placing the pop-up/dialog