Files
nixpkgs/pkgs/by-name/gl/glfw3/window-position.patch
Misaka13514 8af1b65f04 glfw3-minecraft: expand Wayland window position patch
Minecraft Forge utilizes strict error callbacks during initialization.
When running on native Wayland, attempting to set the window position
triggers a `GLFW_FEATURE_UNAVAILABLE` (0x1000C) error in GLFW 3.4,
causing the game to crash immediately.

This updates the existing `window-position.patch` to also demote
the error in `_glfwSetWindowPosWayland` to a stderr warning.

Credit to Prior5151 on AUR for the extended fix approach.
2026-03-12 17:02:58 +08:00

38 lines
1.5 KiB
Diff

Dismiss warnings about window position being unavailable on Wayland.
In addition to the other glfw patches, this one is required on certain
compositors such as niri and waywall to be able to launch Minecraft at
all.
This patch expands the suppression to setting positions. This
prevents Minecraft Forge environments from crashing on Wayland when
strict error callbacks are used.
Original get-position fix by: uku <hi@uku.moe>
Expanded to include set-position, inspired by Prior5151's fix on AUR.
https://aur.archlinux.org/packages/glfw-wayland-minecraft-cursorfix#comment-1013099
--- a/src/wl_window.c
+++ b/src/wl_window.c
@@ -2236,16 +2236,16 @@ void _glfwGetWindowPosWayland(_GLFWwindow* window, int* xpos, int* ypos)
// A Wayland client is not aware of its position, so just warn and leave it
// as (0, 0)
- _glfwInputError(GLFW_FEATURE_UNAVAILABLE,
- "Wayland: The platform does not provide the window position");
+ fprintf(stderr,
+ "[GLFW] Wayland: The platform does not provide the window position\n");
}
void _glfwSetWindowPosWayland(_GLFWwindow* window, int xpos, int ypos)
{
// A Wayland client can not set its position, so just warn
- _glfwInputError(GLFW_FEATURE_UNAVAILABLE,
- "Wayland: The platform does not support setting the window position");
+ fprintf(stderr,
+ "[GLFW] Wayland: The platform does not support setting the window position\n");
}
void _glfwGetWindowSizeWayland(_GLFWwindow* window, int* width, int* height)