Strange about the window -f, as the 2nd call only seems to work if the @window is -hidden or -minimized. As soon as the window becomes visible, it widens - possibly to make more of the titlebar visible, and it won't shrink the @window unless you minimize or hide it again.