Fix layout screwing when the window is minimized