From fb3279fce810208413fd34d1c9b3f2fa09ff7d49 Mon Sep 17 00:00:00 2001 From: AmirAli Mollaei Date: Sat, 13 Dec 2025 18:33:36 +0330 Subject: [PATCH 1/2] added "vkmod.wayland.compat.skip" property to skip wayland compatibility patches --- src/main/java/net/vulkanmod/config/Platform.java | 6 ++++++ .../java/net/vulkanmod/mixin/wayland/InputConstantsM.java | 2 +- .../java/net/vulkanmod/mixin/wayland/MinecraftMixin.java | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/vulkanmod/config/Platform.java b/src/main/java/net/vulkanmod/config/Platform.java index 38914708d..77f3af43d 100644 --- a/src/main/java/net/vulkanmod/config/Platform.java +++ b/src/main/java/net/vulkanmod/config/Platform.java @@ -10,6 +10,7 @@ public abstract class Platform { private static final int activePlat = getSupportedPlat(); private static final String activeDE = determineDE(); + public static final boolean skipWaylandPatches = shouldSkipWaylandPatches(); public static void init() { // Increase stack size to 256 KB to prevent out of stack error on nvidia driver @@ -64,6 +65,11 @@ private static String determineDE() { return "N/A"; } + private static boolean shouldSkipWaylandPatches() { + return System.getProperties().containsKey("vkmod.wayland.compat.skip"); + } + + public static int getActivePlat() { return activePlat; } diff --git a/src/main/java/net/vulkanmod/mixin/wayland/InputConstantsM.java b/src/main/java/net/vulkanmod/mixin/wayland/InputConstantsM.java index 7c4ee506c..9e2e629d2 100644 --- a/src/main/java/net/vulkanmod/mixin/wayland/InputConstantsM.java +++ b/src/main/java/net/vulkanmod/mixin/wayland/InputConstantsM.java @@ -15,7 +15,7 @@ public class InputConstantsM { */ @Redirect(method = "grabOrReleaseMouse", at = @At(value = "INVOKE", target = "Lorg/lwjgl/glfw/GLFW;glfwSetCursorPos(JDD)V")) private static void grabOrReleaseMouse(long window, double xpos, double ypos) { - if (!Platform.isWayLand()) + if (Platform.skipWaylandPatches || !Platform.isWayLand()) GLFW.glfwSetCursorPos(window, xpos, ypos); } } \ No newline at end of file diff --git a/src/main/java/net/vulkanmod/mixin/wayland/MinecraftMixin.java b/src/main/java/net/vulkanmod/mixin/wayland/MinecraftMixin.java index 19d93d508..00f8fd571 100644 --- a/src/main/java/net/vulkanmod/mixin/wayland/MinecraftMixin.java +++ b/src/main/java/net/vulkanmod/mixin/wayland/MinecraftMixin.java @@ -31,7 +31,7 @@ public class MinecraftMixin { */ @Redirect(method="", at=@At(value="INVOKE", target="Lcom/mojang/blaze3d/platform/Window;setIcon(Lnet/minecraft/server/packs/PackResources;Lcom/mojang/blaze3d/platform/IconSet;)V")) private void bypassWaylandIcon(Window instance, PackResources packResources, IconSet iconSet) throws IOException { - if (!Platform.isWayLand()) + if (Platform.skipWaylandPatches || !Platform.isWayLand()) { this.window.setIcon(this.vanillaPackResources, SharedConstants.getCurrentVersion().stable() ? IconSet.RELEASE : IconSet.SNAPSHOT); } From 8648a325a0fab8d1ee591a9b2049a390f52f934d Mon Sep 17 00:00:00 2001 From: AmirAli Mollaei Date: Sat, 13 Dec 2025 20:21:43 +0330 Subject: [PATCH 2/2] made `Platform.shouldSkipWaylandPatches` public --- src/main/java/net/vulkanmod/config/Platform.java | 4 +--- .../java/net/vulkanmod/mixin/wayland/InputConstantsM.java | 2 +- src/main/java/net/vulkanmod/mixin/wayland/MinecraftMixin.java | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/vulkanmod/config/Platform.java b/src/main/java/net/vulkanmod/config/Platform.java index 77f3af43d..20ceef58c 100644 --- a/src/main/java/net/vulkanmod/config/Platform.java +++ b/src/main/java/net/vulkanmod/config/Platform.java @@ -10,7 +10,6 @@ public abstract class Platform { private static final int activePlat = getSupportedPlat(); private static final String activeDE = determineDE(); - public static final boolean skipWaylandPatches = shouldSkipWaylandPatches(); public static void init() { // Increase stack size to 256 KB to prevent out of stack error on nvidia driver @@ -65,11 +64,10 @@ private static String determineDE() { return "N/A"; } - private static boolean shouldSkipWaylandPatches() { + public static boolean shouldSkipWaylandPatches() { return System.getProperties().containsKey("vkmod.wayland.compat.skip"); } - public static int getActivePlat() { return activePlat; } diff --git a/src/main/java/net/vulkanmod/mixin/wayland/InputConstantsM.java b/src/main/java/net/vulkanmod/mixin/wayland/InputConstantsM.java index 9e2e629d2..8f5db821a 100644 --- a/src/main/java/net/vulkanmod/mixin/wayland/InputConstantsM.java +++ b/src/main/java/net/vulkanmod/mixin/wayland/InputConstantsM.java @@ -15,7 +15,7 @@ public class InputConstantsM { */ @Redirect(method = "grabOrReleaseMouse", at = @At(value = "INVOKE", target = "Lorg/lwjgl/glfw/GLFW;glfwSetCursorPos(JDD)V")) private static void grabOrReleaseMouse(long window, double xpos, double ypos) { - if (Platform.skipWaylandPatches || !Platform.isWayLand()) + if (Platform.shouldSkipWaylandPatches() || !Platform.isWayLand()) GLFW.glfwSetCursorPos(window, xpos, ypos); } } \ No newline at end of file diff --git a/src/main/java/net/vulkanmod/mixin/wayland/MinecraftMixin.java b/src/main/java/net/vulkanmod/mixin/wayland/MinecraftMixin.java index 00f8fd571..26fbb879a 100644 --- a/src/main/java/net/vulkanmod/mixin/wayland/MinecraftMixin.java +++ b/src/main/java/net/vulkanmod/mixin/wayland/MinecraftMixin.java @@ -31,7 +31,7 @@ public class MinecraftMixin { */ @Redirect(method="", at=@At(value="INVOKE", target="Lcom/mojang/blaze3d/platform/Window;setIcon(Lnet/minecraft/server/packs/PackResources;Lcom/mojang/blaze3d/platform/IconSet;)V")) private void bypassWaylandIcon(Window instance, PackResources packResources, IconSet iconSet) throws IOException { - if (Platform.skipWaylandPatches || !Platform.isWayLand()) + if (Platform.shouldSkipWaylandPatches() || !Platform.isWayLand()) { this.window.setIcon(this.vanillaPackResources, SharedConstants.getCurrentVersion().stable() ? IconSet.RELEASE : IconSet.SNAPSHOT); }