aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/chat_input
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2023-05-14 14:10:51 +0200
committerfiaxh <git@lightrise.org>2023-05-14 14:12:05 +0200
commit9e4def221fe54bc38ebe9ae10672325d3c9a7f1d (patch)
treebd4cadaa835e8d040d4ede0b7b654a1f8417e284 /main/src/ui/chat_input
parent287d5bee6e335396a362f1563062aef8509c5659 (diff)
downloaddino-9e4def221fe54bc38ebe9ae10672325d3c9a7f1d.tar.gz
dino-9e4def221fe54bc38ebe9ae10672325d3c9a7f1d.zip
Fix chat input for IME
fixes #1419 Co-authored-by: Marvin W <git@larma.de>
Diffstat (limited to 'main/src/ui/chat_input')
-rw-r--r--main/src/ui/chat_input/chat_text_view.vala7
1 files changed, 6 insertions, 1 deletions
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() != "") {