Skip to content
Merged
Changes from all commits
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
5 changes: 4 additions & 1 deletion src/main/java/net/notcoded/wayfix/WayFix.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.");
Expand Down