From 67453cc1a653004ea292945511106c894ee07673 Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Sun, 14 Jan 2024 20:55:03 +0700 Subject: [PATCH 1/2] Fix wayland get window position --- .../main/java/net/neoforged/fml/earlydisplay/DisplayWindow.java | 1 + 1 file changed, 1 insertion(+) diff --git a/earlydisplay/src/main/java/net/neoforged/fml/earlydisplay/DisplayWindow.java b/earlydisplay/src/main/java/net/neoforged/fml/earlydisplay/DisplayWindow.java index bf7968b4c..440cbdce7 100644 --- a/earlydisplay/src/main/java/net/neoforged/fml/earlydisplay/DisplayWindow.java +++ b/earlydisplay/src/main/java/net/neoforged/fml/earlydisplay/DisplayWindow.java @@ -470,6 +470,7 @@ public void initWindow(@Nullable String mcVersion) { glfwGetFramebufferSize(window, x, y); this.fbWidth = x[0]; this.fbHeight = y[0]; + handleLastGLFWError((error, description) -> LOGGER.debug(String.format("Suppressing GLFW get window position error: [0x%X]%s", error, description))); glfwPollEvents(); } From a9fca77fbcb48bf0d191c9f13f003a5f03f9d58c Mon Sep 17 00:00:00 2001 From: Gravita <12893402+gravit0@users.noreply.github.com> Date: Mon, 26 Feb 2024 13:52:26 +0700 Subject: [PATCH 2/2] Moving wayland glfw error handle --- .../main/java/net/neoforged/fml/earlydisplay/DisplayWindow.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earlydisplay/src/main/java/net/neoforged/fml/earlydisplay/DisplayWindow.java b/earlydisplay/src/main/java/net/neoforged/fml/earlydisplay/DisplayWindow.java index 5961ae40d..224dd28f8 100644 --- a/earlydisplay/src/main/java/net/neoforged/fml/earlydisplay/DisplayWindow.java +++ b/earlydisplay/src/main/java/net/neoforged/fml/earlydisplay/DisplayWindow.java @@ -465,12 +465,12 @@ public void initWindow(@Nullable String mcVersion) { // Show the window glfwShowWindow(window); glfwGetWindowPos(window, x, y); + handleLastGLFWError((error, description) -> LOGGER.debug(String.format("Suppressing GLFW get window position error: [0x%X]%s", error, description))); this.winX = x[0]; this.winY = y[0]; glfwGetFramebufferSize(window, x, y); this.fbWidth = x[0]; this.fbHeight = y[0]; - handleLastGLFWError((error, description) -> LOGGER.debug(String.format("Suppressing GLFW get window position error: [0x%X]%s", error, description))); glfwPollEvents(); }