diff --git a/src/main/java/com/cleanroommc/client/ime/WaylandIMEhandler.java b/src/main/java/com/cleanroommc/client/ime/WaylandIMEhandler.java index 75e0c705..c1b1fd19 100644 --- a/src/main/java/com/cleanroommc/client/ime/WaylandIMEhandler.java +++ b/src/main/java/com/cleanroommc/client/ime/WaylandIMEhandler.java @@ -1,10 +1,14 @@ package com.cleanroommc.client.ime; +import org.lwjgl.glfw.GLFW; +import org.lwjgl.opengl.Display; + import java.util.function.Consumer; public class WaylandIMEhandler implements Consumer { + private static final long window = Display.getWindow(); @Override - public void accept(Boolean aBoolean) { - + public void accept(Boolean active) { + GLFW.glfwSetInputMode(window, GLFW.GLFW_IME, active ? GLFW.GLFW_TRUE : GLFW.GLFW_FALSE); } } diff --git a/src/main/java/com/cleanroommc/client/ime/X11IMEHandler.java b/src/main/java/com/cleanroommc/client/ime/X11IMEHandler.java index 0a80c799..dffa14f8 100644 --- a/src/main/java/com/cleanroommc/client/ime/X11IMEHandler.java +++ b/src/main/java/com/cleanroommc/client/ime/X11IMEHandler.java @@ -1,13 +1,12 @@ package com.cleanroommc.client.ime; import org.lwjgl.glfw.GLFW; -import org.lwjgl.glfw.GLFWNativeX11; import org.lwjgl.opengl.Display; import java.util.function.Consumer; public class X11IMEHandler implements Consumer { - private static final long window = GLFWNativeX11.glfwGetX11Window(Display.getWindow()); + private static final long window = Display.getWindow(); @Override public void accept(Boolean active) { GLFW.glfwSetInputMode(window, GLFW.GLFW_IME, active ? GLFW.GLFW_TRUE : GLFW.GLFW_FALSE);