I added this patch although I completely rewrote the NSView changes.
There's more that needs to be done when printing that just reseting the
coordinates so I tried to account for that. It seemed to work for me but
perhaps you can test it again.
I finally tested the changes:
The changes for NSView are not working for subviews. The reason is that in
[NSView displayRectIgnoringOpacity:] unlockFocus is called before the subviews
are drawn, thus recalculating _matrixToWindow.
The attached patch unlocks the focus after drawing the subviews of the view.