From c9260ad82cc392f81a46cdbf218cad2ea401b231 Mon Sep 17 00:00:00 2001 From: Maxim Ganetsky Date: Mon, 16 Sep 2024 18:58:23 +0300 Subject: [PATCH] LCL-Gtk2: Do not reset IM after mouse click, otherwise the composition with pre-existing string will be broken. Patch by rasberryrabbit, issue #41123. --- lcl/interfaces/gtk2/gtk2proc.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/gtk2/gtk2proc.inc b/lcl/interfaces/gtk2/gtk2proc.inc index eaa6f6fe1c..4f42e191ae 100644 --- a/lcl/interfaces/gtk2/gtk2proc.inc +++ b/lcl/interfaces/gtk2/gtk2proc.inc @@ -2203,7 +2203,12 @@ var if im_context_widget<>TargetWidget then begin //DebugLn(['CheckDeadKey init im_context ',GetWidgetDebugReport(TargetWidget)]); - ResetDefaultIMContext; + + // After mouse click, first composition char isn't returned to pre-edit string. + // It has occurred with fcitx IM, but should happen with other IM like nabi too. + // So the following line is commented out to fix this. + //ResetDefaultIMContext; + im_context_widget:=TargetWidget; gtk_im_context_set_client_window(im_context,GetControlWindow(TargetWidget)); //DebugLn(['CheckDeadKey im_context initialized']);