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

isKeyJustPressed & isButtonJustPressed does not trigger consistently at '1.11.0' with gdx-lwjgl3-glfw-awt-macos #7059

Open
damn opened this issue Jan 8, 2023 · 3 comments · May be fixed by #7361

Comments

@damn
Copy link

damn commented Jan 8, 2023

Not using the gdx-lwjgl3-glfw-awt library and using JVM opts "-XstartOnFirstThread" fixes the issue.

  • [ X] macOS
@tommyettinger
Copy link
Member

It seems like -XstartOnFirstThread is the only really reliable way to have LWJGL3 work on MacOS. The StartOnFirstThreadHelper class from Guacamole may make distributing executable JARs easier -- just start your main() method with if (StartOnFirstThreadHelper.startNewJvmIfRequired()) return; and that file takes care of restarting with the necessary argument if it isn't already there. Distributing with Packr or jpackage means users don't need a JDK installed (which can be tricky on MacOS, because of x64 and ARM64 both being used), and both of those can specify -XstartOnFirstThread as an argument when launched via the .app . The need for -XstartOnFirstThread is mostly an issue during development, when JARs are being sent around but not yet packaged with JREs for distribution. Hopefully the class from Guacamole (which really just needs that file, not the library) can help.

@damn
Copy link
Author

damn commented Aug 8, 2023

I am planning to create a debug UI/editor UI as a second window on top / besides my libgdx app.

So I would be interested to fix these issues also. Where would I have to look ?

@crykn
Copy link
Member

crykn commented Aug 9, 2023

I don't think this is as easy to fix as you'd like it to be, but the best place to start looking is the original PR that introduced the extension (#6772).

Apart from that, you could try removing the gdx-lwjgl3-glfw-awt-macos extension and doing this at the beginning of your DesktopLauncher instead:

if (SharedLibraryLoader.isMac && Gdx.app == null) {
    org.lwjgl.system.Configuration.GLFW_LIBRARY_NAME.set("glfw_async");
}

This should have the same effect as our extension, but is offered by LWJGL 3 itself. So they might be able to help you figure out what is causing this.

@crykn crykn linked a pull request Mar 8, 2024 that will close this issue
@crykn crykn linked a pull request Mar 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants