Wayland: A new option to turn off IME

This commit is contained in:
Kovid Goyal
2024-04-05 14:56:11 +05:30
parent f9e38d3311
commit 2c4ffba0f3
15 changed files with 58 additions and 16 deletions

11
glfw/wl_text_input.c vendored
View File

@@ -117,7 +117,7 @@ text_input_done(void *data UNUSED, struct zwp_text_input_v3 *txt_input UNUSED, u
void
_glfwWaylandBindTextInput(struct wl_registry* registry, uint32_t name) {
if (!text_input_manager) text_input_manager = wl_registry_bind(registry, name, &zwp_text_input_manager_v3_interface, 1);
if (!text_input_manager && _glfw.hints.init.wl.ime) text_input_manager = wl_registry_bind(registry, name, &zwp_text_input_manager_v3_interface, 1);
}
void
@@ -130,12 +130,9 @@ _glfwWaylandInitTextInput(void) {
.delete_surrounding_text = text_input_delete_surrounding_text,
.done = text_input_done,
};
if (!text_input) {
if (text_input_manager && _glfw.wl.seat) {
text_input = zwp_text_input_manager_v3_get_text_input(
text_input_manager, _glfw.wl.seat);
if (text_input) zwp_text_input_v3_add_listener(text_input, &text_input_listener, NULL);
}
if (_glfw.hints.init.wl.ime && !text_input && text_input_manager && _glfw.wl.seat) {
text_input = zwp_text_input_manager_v3_get_text_input(text_input_manager, _glfw.wl.seat);
if (text_input) zwp_text_input_v3_add_listener(text_input, &text_input_listener, NULL);
}
}