From b9863b3be7a5579902069bd7b7dbf78802e3e6a1 Mon Sep 17 00:00:00 2001 From: arcade_kappa Date: Mon, 23 Dec 2024 22:24:58 +0800 Subject: [PATCH] Haven't test ime pr on x11 yet --- .../java/com/cleanroommc/client/ime/X11IMEHandler.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/cleanroommc/client/ime/X11IMEHandler.java b/src/main/java/com/cleanroommc/client/ime/X11IMEHandler.java index 35f96e48..0a80c799 100644 --- a/src/main/java/com/cleanroommc/client/ime/X11IMEHandler.java +++ b/src/main/java/com/cleanroommc/client/ime/X11IMEHandler.java @@ -1,10 +1,15 @@ 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()); @Override - public void accept(Boolean aBoolean) { - + public void accept(Boolean active) { + GLFW.glfwSetInputMode(window, GLFW.GLFW_IME, active ? GLFW.GLFW_TRUE : GLFW.GLFW_FALSE); } }