updated window position saving, accounts for min and maximized