Fixed bug on Windows that caused wrong window size to be saved when app is minimized.