Persist the position of the cocoa window
I tend to move the window to another screen, and it's a pain that it doesn't restore to the same place.
This patch fixes that.
Initially I tried just using [NSWindow frameAutosaveName], but it has a few issues:
- when launched from the Terminal, some funny business appears to go on, which means that it always restores the window to the same screen that the Terminal window was on; this is not the behaviour I expected
- because the window can resize multiple times during boot of the guest OS, there's a danger of the originally persisted frame getting wiped out.
So what I did instead was just persist the origin of the window (in the user defaults), whenever the user explicitly moves the window. I then attempt to restore this origin whenever the window is resized by the emulator.
I'm persisting the origin (which is the bottom-left), so the initial frame during boot up doesn't appear to be right, but by the time booting is finished and the window is back to the size it was previously, the origin is correct and everything is hunky dory.
I did this on top of your screamer branch, so I figured I'd make a PR here. I might also try to submit a patch, but I wasn't quite sure whether the cocoa.m from here has a bunch of other changes in it.