From 9e4def221fe54bc38ebe9ae10672325d3c9a7f1d Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sun, 14 May 2023 14:10:51 +0200 Subject: Fix chat input for IME fixes #1419 Co-authored-by: Marvin W --- main/src/ui/chat_input/chat_text_view.vala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'main/src/ui') diff --git a/main/src/ui/chat_input/chat_text_view.vala b/main/src/ui/chat_input/chat_text_view.vala index 3752a1cf..72ebc845 100644 --- a/main/src/ui/chat_input/chat_text_view.vala +++ b/main/src/ui/chat_input/chat_text_view.vala @@ -94,8 +94,13 @@ public class ChatTextView : Box { } } - private bool on_text_input_key_press(uint keyval, uint keycode, Gdk.ModifierType state) { + private bool on_text_input_key_press(EventControllerKey controller, uint keyval, uint keycode, Gdk.ModifierType state) { if (keyval in new uint[]{ Key.Return, Key.KP_Enter }) { + // Allow the text view to process the event. Needed for IME. + if (text_view.im_context_filter_keypress(controller.get_current_event())) { + return true; + } + if ((state & ModifierType.SHIFT_MASK) > 0) { text_view.buffer.insert_at_cursor("\n", 1); } else if (text_view.buffer.text.strip() != "") { -- cgit v1.2.3-70-g09d2