 compute proper position centered window
