BZ-1042509: fixed the buttons + improvements on change perspective that now is interrupted by panels if onMayClose returns false