Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am currently working on a mod that allows Minecraft versions prior to 1.13 to take advantage of high DPI screens on macOS. To accomplish this I am setting the
org.lwjgl.opengl.Display.enableHighDPI
property to true on startup and then injecting calls toDisplay.getPixelScaleFactor()
into Minecraft's code to scale the GUI properly. This works fine when using Mojang's LWJGL 2 libraries with x86_64 java, but when using the binaries provided by this repository with aarch64 java my mod ceases to work. The Minecraft window will only display the bottom left corner of the framebuffer.After some research, I figured out that this is caused by eed74ff. I assume that this change was made to fix the issue with macOS defaulting to a high DPI framebuffer (I discovered that issue when I reverted this commit to see what would happen). That change is fine for normal Minecraft, because it doesn't make use of LWJGL 2's high DPI mode, but it prevents my mod from working.
This PR changes that line so that instead of always setting
setWantsBestResolutionOpenGLSurface
toNO
, it'll set it toYES
if high DPI mode is enabled andNO
if it isn't. This should fix my issue while maintaining compatibility with everyone else. Let me know if you see any problems with my solution.