Problem
Hi all!
When I tried to install the patches on my system (even the one-nineteen and libdecoration branches) GLFW was spitting out the error
Wayland: setting the window position is not supported on this platform.
My system:
- Arch Linux with the
linux kernel
- RTX 3070 Ti with
nvidia-open (545) driver
- i5 12600KF with 16GB RAM
- Forge 27 or vanilla Minecraft 1.20 (also crashes and gets fixed but has a different error)
Solution
To fix this issue, you have to manually apply the patches to the master branch of GLFW.
This fix will break in the future as it is based on the active and changing master branch, not a static release.
Downloading GLFW
You might want to cd into your downloads or temp folder if you don't want to clutter your $HOME.
git clone https://github.com/glfw/glfw.git
cd glfw
Download the patch
I have combined the patches 0003, 0005 and the necessary patch to mute the error that causes forge to crash on start
Copy and paste it into a file called glfw.patch, the last empty line is important as otherwise it refuses to git apply - this file should be located in the glfw dir that you just cd'd into.
gist.github.com/patrickpmueller/3e24a3ba435c1708a3ebace60cfa1dcf
If patch somehow fails (in case GLFW updated their code in this part) manually review patch, find the section of code and replace it. You can use patches from repo, one-nineteen branch, etc. but be sure to add the patch for the window position.
Applying the patch and compiling GLFW
Just run the commands below:
git apply glfw.patch
cmake -S . -B build -D GLFW_USE_WAYLAND=1 -D BUILD_SHARED_LIBS=ON -D GLFW_BUILD_EXAMPLES=no -D GLFW_BUILD_TESTS=no -D GLFW_BUILD_DOCS=no
cd build
make
Using the patched version to start Forge 27
You can
- either install GLFW on your system via
make install
- or use it for Minecraft locally by following the launcher part in github.com/Admicos/minecraft-wayland?tab=readme-ov-file#requirements and pointing it to your patched
./src/libglfw.so.3.4
Export a neccessary environment variable
This is neccessary becuase Minecraft crashed otherwise (I don't have the error message any more, but this fixed it).
Name: __GL_THREADED_OPTIMIZATIONS
Value: 0
Result
This should fix any issues related to Forge 27 and should also fix vanilla 1.20.
I might include a PKGBUILD in the future - or someone can share it if they write it.
Note: this is a temporary fix that just suppresses the errors instead of properly fixing them. However, at least it works without XWayland
Problem
Hi all!
When I tried to install the patches on my system (even the
one-nineteenandlibdecorationbranches) GLFW was spitting out the errorMy system:
linuxkernelnvidia-open(545) driverSolution
To fix this issue, you have to manually apply the patches to the
masterbranch of GLFW.This fix will break in the future as it is based on the active and changing
masterbranch, not a static release.Downloading GLFW
You might want to
cdinto your downloads or temp folder if you don't want to clutter your$HOME.Download the patch
I have combined the patches
0003,0005and the necessary patch to mute the error that causes forge to crash on startCopy and paste it into a file called
glfw.patch, the last empty line is important as otherwise it refuses togit apply- this file should be located in theglfwdir that you justcd'd into.gist.github.com/patrickpmueller/3e24a3ba435c1708a3ebace60cfa1dcf
If patch somehow fails (in case GLFW updated their code in this part) manually review patch, find the section of code and replace it. You can use patches from repo, one-nineteen branch, etc. but be sure to add the patch for the window position.
Applying the patch and compiling GLFW
Just run the commands below:
Using the patched version to start Forge 27
You can
make install./src/libglfw.so.3.4Export a neccessary environment variable
This is neccessary becuase Minecraft crashed otherwise (I don't have the error message any more, but this fixed it).
Name:
__GL_THREADED_OPTIMIZATIONSValue:
0Result
This should fix any issues related to Forge 27 and should also fix vanilla 1.20.
I might include a PKGBUILD in the future - or someone can share it if they write it.
Note: this is a temporary fix that just suppresses the errors instead of properly fixing them. However, at least it works without XWayland