diff --git a/src/main/java/net/notcoded/wayfix/WayFix.java b/src/main/java/net/notcoded/wayfix/WayFix.java index c1a2467..30fef4f 100644 --- a/src/main/java/net/notcoded/wayfix/WayFix.java +++ b/src/main/java/net/notcoded/wayfix/WayFix.java @@ -10,6 +10,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.lwjgl.glfw.GLFW; +import java.util.Objects; public class WayFix { public static final Logger LOGGER = LogManager.getLogger(WayFix.class); @@ -35,7 +36,9 @@ public static boolean isWayland() { public static boolean supportsWayland() { try { - return GLFW.glfwPlatformSupported(GLFW.GLFW_PLATFORM_WAYLAND); + return GLFW.glfwPlatformSupported(GLFW.GLFW_PLATFORM_WAYLAND) && + Objects.requireNonNullElse(System.getenv("XDG_SESSION_TYPE"), + "").toLowerCase().startsWith("wayland"); } catch (NoSuchMethodError ignored) { // <3.3.0 LOGGER.warn("WayFix is disabling itself due to the LWJGL Version being too low."); LOGGER.warn("Please update to a LWJGL version such as '3.3.1' or higher.");