I have a NSWindow subclass and a custom NSView for its contentView. The drawing is done using Metal or OpenGL and I'm doing that in the NSView's drawRect method.
Now, when entering fullscreen using [window toggleFullscreen] the window is resized and while this is happening, the content is still displayed with the old smaller size in the lower left corner. It is only redrawn to the full window once the window is done animating which looks quite ugly. I tried doing an update in the windowDidResize method but that had no effect. How can I update the content while the window is entering fullscreen mode (or maybe just tell it to be scaled with the window)?
Also, I noticed that when I enter fullscreen using the green button in the window's title bar, everything looks as expected. So this must be doing something else as toggleFullscreen but that's the only API I could find for that.