Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/main/java/net/vulkanmod/config/Platform.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class MinecraftMixin {
*/
@Redirect(method="<init>", 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);
}
Expand Down