stable window resizing

Updated frame calculation and position anchoring in WM_SIZING for
stability.