From aefa36e90bb7d11881138ec6acd82f245f2c346d Mon Sep 17 00:00:00 2001 From: johnsonj Date: Fri, 16 May 2025 12:12:13 +1000 Subject: Feature [feature-requests:#1488]. Update IME cursor position inside retrieve surrounding to better position candidate window. --- gtk/ScintillaGTK.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gtk') diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 4c71d4a7e..3f8ce2d9e 100755 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -2604,6 +2604,13 @@ bool ScintillaGTK::RetrieveSurroundingThis(GtkIMContext *context) { std::string utf8Text = UTF8FromEncoded(RangeText(startByte, endByte)); gint cursorIndex = UTF8FromEncoded(RangeText(startByte, pos)).length(); + if (pdoc->TentativeActive()) { + // Prepare one line feed with no preedit under PreeditChangedInlineThis(); + } else { + // reconvert key triggers CandidateBox to show up + // when quick phrase input on fcitx (or maybe accented input on mac) + SetCandidateWindowPos(); + } gtk_im_context_set_surrounding(context, &utf8Text[0], utf8Text.length(), cursorIndex); return true; -- cgit v1.2.3