opendlg: use state matchine to guess width and height