patch doLayout called when not necessary.