Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request / Vanilla Bug] LWJGL Exception While Entering Full Screen Mode #6

Open
halotroop2288 opened this issue Jun 28, 2022 · 11 comments

Comments

@halotroop2288
Copy link

I'm not sure what plays into this bug, but sometimes, vanilla b1.7.3 will just crash when you press F11 to enter fullscreen mode. Can you add a fix for this bug in this mod?

Stacktrace
org.lwjgl.LWJGLException: Failed to set display mode (-2).
	at org.lwjgl.opengl.WindowsDisplay.nSwitchDisplayMode(Native Method)
	at org.lwjgl.opengl.WindowsDisplay.switchDisplayMode(WindowsDisplay.java:359)
	at org.lwjgl.opengl.Display.switchDisplayMode(Display.java:359)
	at org.lwjgl.opengl.Display.setDisplayModeAndFullscreenInternal(Display.java:507)
	at org.lwjgl.opengl.Display.setFullscreen(Display.java:475)
	at net.minecraft.client.Minecraft.method_2136(Minecraft.java:1184)
	at net.minecraft.class_32.method_132(class_32.java:131)
	at net.minecraft.class_32.method_130(class_32.java:112)
	at net.minecraft.client.Minecraft.method_2137(Minecraft.java:1299)
	at net.minecraft.client.Minecraft.run(Minecraft.java:754)
	at java.lang.Thread.run(Thread.java:750)
java.lang.IllegalStateException: Keyboard must be created before you can read events
	at org.lwjgl.input.Keyboard.next(Keyboard.java:475)
	at net.minecraft.class_32.method_130(class_32.java:111)
	at net.minecraft.client.Minecraft.method_2137(Minecraft.java:1299)
	at net.minecraft.client.Minecraft.run(Minecraft.java:754)
	at java.lang.Thread.run(Thread.java:750)
@js6pak
Copy link
Owner

js6pak commented Jun 28, 2022

Does it also happen in vanilla? Babric (and by extension mojangfix) use master branch lwjgl (https://github.com/babric/lwjgl) so it might be caused by that (on the other hand it fixes fullscreen on linux 😅)

@halotroop2288
Copy link
Author

halotroop2288 commented Jun 28, 2022

Yes. It happens in vanilla without Fabric installed too. It happens on both the latest LWJGL2 2.9.4-nightly provided by PolyMC, and on stable 2.9.3.
Note that I am using PolyMC as my launcher. And Java 8 Temurin.

@js6pak
Copy link
Owner

js6pak commented Jun 28, 2022

I love how the relevant code https://github.com/babric/lwjgl/blob/master/src/native/windows/display.c#L145 wasn't touched in 17 years...
The return code is DISP_CHANGE_BADMODE whatever that means.
Does the crash happen every time you try to enter fullscreen?

@js6pak
Copy link
Owner

js6pak commented Jun 28, 2022

Do you have multiple monitors? And if so is it crashing when you try to fullscreen on every one of them?

@halotroop2288
Copy link
Author

It happens within a certain time of starting the game. The exception might be a hint as to why. Maybe the "keyboard" only gets set up later, and that causes LWJGL to shit itself. It fails to bind a controller for the keyboard too, but that never seems to become an issue.

@halotroop2288
Copy link
Author

I do have multiple monitors. I don't know if that's causing it, but it seems unlikely because it only happens sometimes, and I always use my main monitor.

@js6pak
Copy link
Owner

js6pak commented Jun 28, 2022

I wouldn't worry about the keyboard stuff too much, it looks like it just crashes before it has a chance to initialize it.

@js6pak js6pak assigned js6pak and unassigned js6pak Jun 29, 2022
@js6pak
Copy link
Owner

js6pak commented Jun 29, 2022

As I don't have a windows machine with a multi monitor setup I asked @calmilamsy to test and but he can't reproduce the issue.

@halotroop2288
Copy link
Author

I don't trust calmilamsy anyway. That's like asking LexManos for help. So, ask someone else.

@halotroop2288
Copy link
Author

halotroop2288 commented Jul 1, 2022

This bug only occurs while using an incompatible version of Java (in this case Java 17).

@halotroop2288
Copy link
Author

OK, nevermind. This bug DOES occur while using Java 8.
I thought it was connected to a similar bug that DOES occur only in Java 17, the resolution being incorrect!

@halotroop2288 halotroop2288 reopened this Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants