Ok, here comes a patch file for the "maximize" and "NSTRACE" rewrites, see the file "emacs-commit-message.txt" for details. I would like you (especially Keith, since Martin don't use OS X) to take a look at it before I post in on emacs-devel and (unless people object) I commit it.
The rewrite became a bit larger than I originally expected since I realised that the system to snap the frame size to the text grid was fundamentally broken. It used a features called "SetResizeIncrements", where the increments were set to the size of the current font. Unfortunately, once the frame size got out of sync (e.g. by setting the frame size to a specific pixel value) it remained out of sync. In addition, it interfered with the maximization system.
The current implementation snaps the frame size to the text grid in a callback function.
The patch below contains excluded code to maximize the frame the old way using the system "zoom" function, and an excluded code section for a hybrid maximize solution. Also, the code to restrict a frame to the screen height is still present but excluded. Before I commit this to the archive I will remove the excluded code, unless someone thinks that its worth while to allow the user to configure this.
You can enable the NSTRACE system by uncommenting a line in nsterm.h, see comments for detail.
In addition, I have included my own test file for frame maximization I wrote to ensure that I didn't introduce any problems. Martin, if there are anything in this you can use for your frame test file, feel free to use it.
Sincerely,
Anders Lindgren