Fix centerWindow() when the taskbar is located along the top or left screen edge

centerWindow() will not center the window correctly when the taskbar is located along the top or left screen edge.