Framebuffer resized to quarter of screen after taking screenshot
After taking a screenshot, the render area only fills the bottom quarter of the screen:
Resizing the window results in the render area once again filling the screen.
The screenshot itself is the expected size and does not have any problems.
I poked a little bit in the source code and found the following values in the Minecraft Window object before the initial framebuffer resize in the refresh() method:
I am guessing this is due to using MacOS which does weird UI scaling stuff with the Retina display resolution. It is likely that this stems from GLFW being aware of the retina scaling and identifying that the OS' window size is scaled relative to the actual pixel (framebuffer) size unless overridden by setting GLFW_COCOA_RETINA_FRAMEBUFFER to false.
After the screenshot is taken Fabrishot.refresh() resizes the framebuffer to the window size, which is a quarter of the initial framebuffer size. This is what seems to be causing the issue in my setup.
As an experiment I changed the framebuffer.resize call to use getWidth & getHeight, and changed the WindowMixin to use getWidth/Height instead of getScreenWidth/Height. This seems to have resolved the issue on my Mac and also worked as expected on a Linux machine.
Curious about your thoughts on this. I could provide a pull request if you are interested in taking a look and wanted to test these changes.