Skip to content

Commit 6262694

Browse files
committed
[FIX] Improve Wayland support
1 parent 5440202 commit 6262694

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

components/launcher-runtime/src/main/java/pro/gravit/launcher/runtime/backend/ProfileSettingsImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ public ProfileSettingsImpl(ClientProfile profile) {
4444
this.flags.add(Flag.FULLSCREEN);
4545
}
4646
this.view = new OptionalView(profile);
47+
if(JVMHelper.OS_TYPE == JVMHelper.OS.LINUX && System.getenv("WAYLAND_DISPLAY") != null) {
48+
this.flags.add(Flag.LINUX_WAYLAND_SUPPORT);
49+
}
4750
}
4851

4952
@Override

components/launcher-runtime/src/main/java/pro/gravit/launcher/runtime/client/ClientLauncherProcess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public void start(boolean pipeOutput) throws IOException, InterruptedException {
220220
// https://github.com/Admicos/minecraft-wayland/issues/55
221221
env.put("__GL_THREADED_OPTIMIZATIONS", "0");
222222
if(params.lwjglGlfwWayland && !params.profile.hasFlag(ClientProfile.CompatibilityFlags.WAYLAND_USE_CUSTOM_GLFW)) {
223-
env.remove("DISPLAY"); // No X11
223+
env.putIfAbsent("GDK_BACKEND", "wayland");
224224
}
225225
}
226226
if(JVMHelper.OS_TYPE != JVMHelper.OS.MUSTDIE) {

0 commit comments

Comments
 (0)