mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +03:00
[FIX] Improve Wayland support
This commit is contained in:
parent
6c0500f528
commit
31489a2b24
3 changed files with 12 additions and 4 deletions
|
@ -171,6 +171,14 @@ public void start(boolean pipeOutput) throws IOException, InterruptedException {
|
|||
LogHelper.debug("Commandline: %s", Arrays.toString(processArgs.toArray()));
|
||||
ProcessBuilder processBuilder = new ProcessBuilder(processArgs);
|
||||
EnvHelper.addEnv(processBuilder);
|
||||
if(JVMHelper.OS_TYPE == JVMHelper.OS.LINUX){
|
||||
var env = processBuilder.environment();
|
||||
// https://github.com/Admicos/minecraft-wayland/issues/55
|
||||
env.put("__GL_THREADED_OPTIMIZATIONS", "0");
|
||||
if(params.lwjglGlfwWayland) {
|
||||
env.remove("DISPLAY"); // No X11
|
||||
}
|
||||
}
|
||||
processBuilder.environment().put("JAVA_HOME", javaVersion.jvmDir.toAbsolutePath().toString());
|
||||
processBuilder.environment().putAll(systemEnv);
|
||||
processBuilder.directory(workDir.toFile());
|
||||
|
|
|
@ -466,7 +466,7 @@ public enum ClassLoaderConfig {
|
|||
}
|
||||
|
||||
public enum CompatibilityFlags {
|
||||
LEGACY_NATIVES_DIR, CLASS_CONTROL_API, ENABLE_HACKS
|
||||
LEGACY_NATIVES_DIR, CLASS_CONTROL_API, ENABLE_HACKS, WAYLAND_USE_CUSTOM_GLFW
|
||||
}
|
||||
|
||||
public static class Version implements Comparable<Version> {
|
||||
|
|
|
@ -176,9 +176,9 @@ private static void realMain(String[] args) throws Throwable {
|
|||
if(profile.hasFlag(ClientProfile.CompatibilityFlags.CLASS_CONTROL_API)) {
|
||||
ClientService.classLoaderControl = classLoaderControl;
|
||||
}
|
||||
if(params.lwjglGlfwWayland) {
|
||||
String glfwPath = ClientService.findLibrary("glfw_wayland");
|
||||
System.setProperty("org.lwjgl.glfw.libname", glfwPath);
|
||||
if(params.lwjglGlfwWayland && profile.hasFlag(ClientProfile.CompatibilityFlags.WAYLAND_USE_CUSTOM_GLFW)) {
|
||||
String glfwName = ClientService.findLibrary("glfw_wayland");
|
||||
System.setProperty("org.lwjgl.glfw.libname", glfwName);
|
||||
}
|
||||
AuthService.projectName = Launcher.getConfig().projectName;
|
||||
AuthService.username = params.playerProfile.username;
|
||||
|
|
Loading…
Reference in a new issue