LWJGL / lwjgl3

LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL, Vulkan, bgfx), audio (OpenAL, Opus), parallel computing (OpenCL, CUDA) and XR (OpenVR, LibOVR, OpenXR) applications.
https://www.lwjgl.org
BSD 3-Clause "New" or "Revised" License
4.74k stars 632 forks source link

LWJGL 3.3.4 GLFW issues on Linux Wayland #998

Open generaloss opened 1 month ago

generaloss commented 1 month ago

Version

3.3.4

Platform

Linux x64

JDK

17, 22

Module

GLFW

Bug description

Arch Linux x64 6.10.3-arch1-1, KDE Plasma 6.1.3, Wayland


https://github.com/user-attachments/assets/af583e86-28fe-40fe-9d58-7d78d204a561

Stacktrace or crash log output

No response

tomwmth commented 1 week ago

Similar issue, but with a dialog window displaying the error callback

Platform: Arch Linux x64 6.10.8-arch1-1, KDE Plasma 6.1.4, Wayland

https://github.com/user-attachments/assets/285535fb-b18c-41dd-8503-86937748c81b

kles4enko commented 1 week ago

I had something similar with 3.3.4 binaries on MacOS as well (see: https://github.com/LWJGL/lwjgl3/issues/1000) It seems that native artifacts for 3.3.4 was compiled in broken CI environment...

Spasi commented 1 week ago

Hey,

@kles4enko The MoltenVK issue is known and unrelated. It also has very high priority and I'm trying to prepare the 3.3.5 release asap. In the meantime, the latest snapshot of libMoltenVK.dylib has been fixed and you can use it with 3.3.4 (download the shared library and point to it with -Dorg.lwjgl.vulkan.libname or Configuration.VULKAN_LIBRARY_NAME).

@generaloss The functionality you mention as not working is documented as not supported on Wayland by GLFW itself. For example, the note for glfwSetWindowPos is:

Wayland: There is no way for an application to set the global position of its windows. This function will emit GLFW_FEATURE_UNAVAILABLE.

If you're seeing differences between 3.3.3 and 3.3.4, it may be something else that has changed. Are you sure that the Wayland backend is even used when running on 3.3.3?

generaloss commented 1 week ago

@Spasi I’m sure I used the Wayland backend if GLFW in LWJGL 3.3.3 cannot use any installed backend regardless of which one is running. I don’t know how to check it.

Spasi commented 1 week ago

@generaloss Try the GLFW_PLATFORM hint with values GLFW_PLATFORM_X11 and GLFW_PLATFORM_WAYLAND. Then call glfwGetPlatform() to see what backend you get.

generaloss commented 1 week ago

@Spasi Indeed, LWJGL 3.3.3 automatically selects the X11 backend while 3.3.4 selects Wayland.