File tree Expand file tree Collapse file tree
src/main/java/net/notcoded/wayfix Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010import org .apache .logging .log4j .LogManager ;
1111import org .apache .logging .log4j .Logger ;
1212import org .lwjgl .glfw .GLFW ;
13+ import java .util .Objects ;
1314
1415public class WayFix {
1516 public static final Logger LOGGER = LogManager .getLogger (WayFix .class );
@@ -35,7 +36,9 @@ public static boolean isWayland() {
3536
3637 public static boolean supportsWayland () {
3738 try {
38- return GLFW .glfwPlatformSupported (GLFW .GLFW_PLATFORM_WAYLAND );
39+ return GLFW .glfwPlatformSupported (GLFW .GLFW_PLATFORM_WAYLAND ) &&
40+ Objects .requireNonNullElse (System .getenv ("XDG_SESSION_TYPE" ),
41+ "" ).toLowerCase ().startsWith ("wayland" );
3942 } catch (NoSuchMethodError ignored ) { // <3.3.0
4043 LOGGER .warn ("WayFix is disabling itself due to the LWJGL Version being too low." );
4144 LOGGER .warn ("Please update to a LWJGL version such as '3.3.1' or higher." );
You can’t perform that action at this time.
0 commit comments