I can't seem to get the proper position and size of a window(the main application window).

using getPosition and getSize. It seems to return some of the values correctly some of the time.

I mainly want to save and restore the position and size of windows but nothing ever seems correct and I can't find the right place to do it(I do it after onShow and onHide.